storj/Jenkinsfile

67 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-04-25 19:04:12 +01:00
node('node') {
try {
currentBuild.result = "SUCCESS"
2018-04-25 19:04:12 +01:00
stage('Checkout') {
checkout scm
echo "Current build result: ${currentBuild.result}"
}
2018-04-25 19:04:12 +01:00
stage('Build Images') {
sh 'make test-docker images'
echo "Current build result: ${currentBuild.result}"
}
2018-04-25 19:04:12 +01:00
stage('Build Binaries') {
sh 'make binaries'
echo "Current build result: ${currentBuild.result}"
}
stage('Push Images') {
if (env.BRANCH_NAME == "master") {
echo 'Push to Repo'
sh 'make push-images'
}
echo "Current build result: ${currentBuild.result}"
}
if (env.BRANCH_NAME == "master") {
/* This should only deploy to staging if the branch is master */
stage('Deploy') {
sh 'make deploy'
sh 'make binaries-upload'
echo "Current build result: ${currentBuild.result}"
}
}
2018-04-25 19:04:12 +01:00
}
catch (err) {
echo "Caught errors! ${err}"
echo "Setting build result to FAILURE"
2018-04-25 19:04:12 +01:00
currentBuild.result = "FAILURE"
/*
mail body: "project build error is here: ${env.BUILD_URL}" ,
from: 'build@storj.io',
replyTo: 'build@storj.io',
subject: 'project build failed',
to: "${env.CHANGE_AUTHOR_EMAIL}"
throw err
*/
}
finally {
stage('Cleanup') {
sh 'make test-docker-clean clean-images'
deleteDir()
}
2018-04-25 19:04:12 +01:00
}
}