Skip to content

Instantly share code, notes, and snippets.

@michaelneale
Last active October 10, 2017 09:44
Show Gist options
  • Select an option

  • Save michaelneale/29aa81ee3617b17c540bcd20fe7a21d4 to your computer and use it in GitHub Desktop.

Select an option

Save michaelneale/29aa81ee3617b17c540bcd20fe7a21d4 to your computer and use it in GitHub Desktop.
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 'npm test'
}
}
stage('Deliver') {
steps {
sh 'npm run build'
sh '''
npm start &
echo $! > .pidfile
'''
input message:'Finished visiting the web site?'
sh 'kill $(cat .pidfile)'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment