2018-04-25 19:04:12 +01:00
|
|
|
node('node') {
|
|
|
|
try {
|
|
|
|
|
2018-07-13 16:02:33 +01:00
|
|
|
stage('Checkout') {
|
|
|
|
checkout scm
|
|
|
|
}
|
2018-04-25 19:04:12 +01:00
|
|
|
|
2018-07-13 16:02:33 +01:00
|
|
|
stage('Build Images') {
|
2018-07-25 22:47:02 +01:00
|
|
|
sh 'make test-docker images'
|
2018-07-13 16:02:33 +01:00
|
|
|
}
|
2018-04-25 19:04:12 +01:00
|
|
|
|
2018-08-14 16:00:39 +01:00
|
|
|
stage('Push Images') {
|
|
|
|
echo 'Push to Repo'
|
|
|
|
sh 'make push-images'
|
|
|
|
}
|
|
|
|
|
2018-07-13 16:02:33 +01:00
|
|
|
stage('Deploy') {
|
2018-08-14 16:00:39 +01:00
|
|
|
/* This should only deploy to staging if the branch is master */
|
|
|
|
if (env.BRANCH_NAME == "master") {
|
|
|
|
sh "./scripts/deploy.staging.sh satellite storjlabs/storj-satellite:${commit_id}"
|
|
|
|
for (int i = 1; i < 60; i++) {
|
|
|
|
sh "./scripts/deploy.staging.sh storage-node-${i} storjlabs/storj-storage-node:${commit_id}"
|
|
|
|
}
|
2018-07-13 16:02:33 +01:00
|
|
|
}
|
2018-08-14 16:00:39 +01:00
|
|
|
|
|
|
|
return
|
2018-07-13 16:02:33 +01:00
|
|
|
}
|
2018-04-25 19:04:12 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
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
|
|
|
|
*/
|
2018-07-13 16:02:33 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
|
|
|
|
stage('Cleanup') {
|
2018-07-25 22:47:02 +01:00
|
|
|
sh 'make test-docker-clean clean-images'
|
2018-07-13 16:02:33 +01:00
|
|
|
deleteDir()
|
|
|
|
}
|
|
|
|
|
2018-04-25 19:04:12 +01:00
|
|
|
}
|
|
|
|
}
|