From 040704ed2d7394f84abef0def803de10f6668696 Mon Sep 17 00:00:00 2001 From: Uldis Sturms Date: Fri, 13 Jan 2017 23:01:33 +0000 Subject: [PATCH] simple node app that can be built from drone --- .drone.yml | 6 ++++++ Dockerfile | 1 + index.js | 5 +++++ index.spec.js | 6 ++++++ package.json | 23 +++++++++++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 index.js create mode 100644 index.spec.js create mode 100644 package.json diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e7e3e47 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,6 @@ +pipeline: + build: + image: node:slim + commands: + - npm install + - npm test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf45650 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM node:onbuild diff --git a/index.js b/index.js new file mode 100644 index 0000000..92ac8d6 --- /dev/null +++ b/index.js @@ -0,0 +1,5 @@ +console.log('=========================================') +console.log('starting...') +console.log('running nodejs built by drone...') +console.log('done...') +console.log('=========================================') diff --git a/index.spec.js b/index.spec.js new file mode 100644 index 0000000..99c0868 --- /dev/null +++ b/index.spec.js @@ -0,0 +1,6 @@ +const test = require('tape') + +test('this always passes', t => { + t.pass() + t.end() +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..3d35139 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "drone-nodejs-spike", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node index.js", + "test": "tape *.spec.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/uldissturms/drone-nodejs-spike.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/uldissturms/drone-nodejs-spike/issues" + }, + "homepage": "https://github.com/uldissturms/drone-nodejs-spike#readme", + "devDependencies": { + "tape": "^4.6.3" + } +}