From ed3be07632122dcde90b7d9723759bf317f3a2f0 Mon Sep 17 00:00:00 2001 From: baiyaaaaa Date: Sun, 16 Sep 2018 19:16:59 +0800 Subject: [PATCH 1/3] Add initial pipline --- Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..a83d1ea37a --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,16 @@ +pipeline { + agent { + docker { + args '-p 3000:3000' + image 'node:6-alpine' + } + + } + stages { + stage('Build') { + steps { + sh 'npm install' + } + } + } +} \ No newline at end of file From 639919f54ef8922308515bdee253f6b139b76be1 Mon Sep 17 00:00:00 2001 From: baiyaaaaa Date: Sun, 16 Sep 2018 20:08:12 +0800 Subject: [PATCH 2/3] Add Test script --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index a83d1ea37a..d766b69b25 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,5 +12,13 @@ pipeline { sh 'npm install' } } + stage('Test') { + environment { + CI = 'true' + } + steps { + sh './jenkins/scripts/test.sh' + } + } } } \ No newline at end of file From 489795ec4477d58281f6d1a8549eae24417d20ee Mon Sep 17 00:00:00 2001 From: "haiping.zhp" Date: Sun, 16 Sep 2018 20:27:55 +0800 Subject: [PATCH 3/3] test --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a36e36b2c..2c6ee61a2c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# simple-node-js-react-npm-app + simple-node-js-react-npm-app This repository is for the [Build a Node.js and React app with npm](https://jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/) @@ -11,4 +11,4 @@ check that the application renders satisfactorily. The `jenkins` directory contains an example of the `Jenkinsfile` (i.e. Pipeline) you'll be creating yourself during the tutorial and the `scripts` subdirectory contains shell scripts with commands that are executed when Jenkins processes -the "Test" and "Deliver" stages of your Pipeline. +the "Test" and "Deliver" stagues of your Pipeline.