Catch the Stage properly for Alerts (#3753)
This commit is contained in:
parent
14b43b7e9b
commit
23463e1dc3
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
@ -1,15 +1,18 @@
|
||||
def lastStage = ''
|
||||
node('node') {
|
||||
properties([disableConcurrentBuilds()])
|
||||
try {
|
||||
currentBuild.result = "SUCCESS"
|
||||
|
||||
stage('Checkout') {
|
||||
lastStage = env.STAGE_NAME
|
||||
checkout scm
|
||||
|
||||
echo "Current build result: ${currentBuild.result}"
|
||||
}
|
||||
if (env.BRANCH_NAME == "master") {
|
||||
stage('Run Versions Test') {
|
||||
lastStage = env.STAGE_NAME
|
||||
try {
|
||||
echo "Running Versions test"
|
||||
|
||||
@ -44,6 +47,7 @@ node('node') {
|
||||
}
|
||||
|
||||
stage('Run Rolling Upgrade Test') {
|
||||
lastStage = env.STAGE_NAME
|
||||
try {
|
||||
echo "Running Rolling Upgrade test"
|
||||
|
||||
@ -77,6 +81,7 @@ node('node') {
|
||||
}
|
||||
|
||||
stage('Build Binaries') {
|
||||
lastStage = env.STAGE_NAME
|
||||
sh 'make binaries'
|
||||
|
||||
stash name: "storagenode-binaries", includes: "release/**/storagenode*.exe"
|
||||
@ -85,6 +90,7 @@ node('node') {
|
||||
}
|
||||
|
||||
stage('Build Windows Installer') {
|
||||
lastStage = env.STAGE_NAME
|
||||
node('windows') {
|
||||
checkout scm
|
||||
|
||||
@ -99,6 +105,7 @@ node('node') {
|
||||
}
|
||||
|
||||
stage('Sign Windows Installer') {
|
||||
lastStage = env.STAGE_NAME
|
||||
unstash "storagenode-installer"
|
||||
|
||||
sh 'make sign-windows-installer'
|
||||
@ -107,19 +114,23 @@ node('node') {
|
||||
}
|
||||
|
||||
stage('Build Images') {
|
||||
lastStage = env.STAGE_NAME
|
||||
sh 'make images'
|
||||
|
||||
echo "Current build result: ${currentBuild.result}"
|
||||
}
|
||||
|
||||
stage('Push Images') {
|
||||
echo 'Push to Repo'
|
||||
lastStage = env.STAGE_NAME
|
||||
sh 'make push-images'
|
||||
|
||||
echo "Current build result: ${currentBuild.result}"
|
||||
}
|
||||
|
||||
stage('Upload') {
|
||||
lastStage = env.STAGE_NAME
|
||||
sh 'make binaries-upload'
|
||||
|
||||
echo "Current build result: ${currentBuild.result}"
|
||||
}
|
||||
|
||||
@ -129,7 +140,7 @@ node('node') {
|
||||
echo "Setting build result to FAILURE"
|
||||
currentBuild.result = "FAILURE"
|
||||
|
||||
slackSend color: 'danger', message: "@build-team ${env.BRANCH_NAME} build failed during stage ${env.STAGE_NAME} ${env.BUILD_URL}"
|
||||
slackSend color: 'danger', message: "@build-team ${env.BRANCH_NAME} build failed during stage ${lastStage} ${env.BUILD_URL}"
|
||||
|
||||
mail from: 'builds@storj.io',
|
||||
replyTo: 'builds@storj.io',
|
||||
|
Loading…
Reference in New Issue
Block a user