init
continuous-integration/drone/push Build is failing Details

master
wanggang 4 years ago
commit 4ba52d63ca

@ -0,0 +1,25 @@
kind: pipeline
type: docker
name: default
platform:
arch: amd64
os: linux
steps:
- name: test
image: node:16.2.0
commands:
- node -v
- npm -v
- yarn --version
- yarn install
- yarn run test
- name: publish
image: plugins/docker:19.03.8
environment:
PLUGIN_REGISTRY: 192.168.100.144:5000
PLUGIN_REPO: 192.168.100.144:5000/node/example
settings:
insecure: true
tags:
- latest
- ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}-${DRONE_REPO_BRANCH}-${DRONE_COMMIT_SHA:0:8}

@ -0,0 +1,8 @@
FROM node:16.2.0
EXPOSE 8080
WORKDIR /app
ADD app.js /app/
ADD node_modules /app/node_modules
CMD [ "node", "app.js" ]

@ -0,0 +1,2 @@
# example

@ -0,0 +1,19 @@
const express = require("express");
const app = express();
const port = process.env.PORT || 8080;
app.get("/", (req, res) => {
res.send(
"<h1 style='text-align: center; font-size: 64px'>This is Demo site from node.js project</h1>"
);
});
app.get("/user", function(req, res) {
res.status(200).json({ name: "appleboy" });
});
// listen 8080 port
app.listen(port);
console.log("Listening on port " + port);
module.exports = app; // for testing

@ -0,0 +1,24 @@
{
"name": "drone-nodejs-example",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/go-training/drone-nodejs-example.git",
"author": "Bo-Yi Wu <appleboy.tw@gmail.com>",
"license": "MIT",
"dependencies": {
"express": "^4.16.1",
"mocha": "^3.5.0"
},
"scripts": {
"test": "mocha test",
"lint": "eslint ./"
},
"devDependencies": {
"eslint": "^4.8.0",
"eslint-config-prettier": "^2.6.0",
"eslint-plugin-prettier": "^2.3.1",
"prettier": "1.7.4",
"should": "^13.1.1",
"supertest": "^3.0.0"
}
}
Loading…
Cancel
Save