diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..4af8e70ef9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +pipeline { + agent { + docker { + image 'node:6-alpine' + args '-p 3000:3000' + } + } + environment { + CI = 'true' + } + stages { + stage('Build') { + steps { + sh 'npm install' + } + } + stage('Test') { + steps { + sh './jenkins/scripts/test.sh' + } + } + stage('Deliver') { + steps { + sh './jenkins/scripts/deliver.sh' + input message: 'Finished using the web site? (Click "Proceed" to continue)' + sh './jenkins/scripts/kill.sh' + } + } + + } +} diff --git a/README.md b/README.md index 8a36e36b2c..055dfa8a4d 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,6 @@ 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. + +This node app is used in Jenkins tutorial: +- https://jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/#run-jenkins-in-docker