Skip to content

Commit 1f412af

Browse files
fix(CI): False doesn't abort build (#158)
1 parent 9d52c27 commit 1f412af

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Jenkinsfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def make = { String target ->
1010
sh "make ${target} fileperms"
1111
} catch(error) {
1212
sh "make fileperms"
13-
false
13+
throw error
1414
}
1515
}
1616

@@ -24,7 +24,7 @@ def gcs_cmd = { String cmd ->
2424
sh(gcs_cmd + cmd)
2525
} catch(error) {
2626
sh(gcs_cmd + gcs_cleanup_cmd)
27-
error 'gcs error'
27+
throw error
2828
}
2929
}
3030

@@ -184,10 +184,13 @@ waitUntil {
184184
}
185185
true
186186
} catch(error) {
187+
if (git_branch == "remotes/origin/master") {
188+
throw error
189+
}
190+
187191
node('linux') {
188-
if (git_branch != "remotes/origin/master") {
189-
withCredentials([[$class: 'StringBinding', credentialsId: '8a727911-596f-4057-97c2-b9e23de5268d', variable: 'SLACKEMAIL']]) {
190-
mail body: """<!DOCTYPE html>
192+
withCredentials([[$class: 'StringBinding', credentialsId: '8a727911-596f-4057-97c2-b9e23de5268d', variable: 'SLACKEMAIL']]) {
193+
mail body: """<!DOCTYPE html>
191194
<html>
192195
<head>
193196
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
@@ -201,10 +204,8 @@ Commit: ${env.CHANGE_TITLE}<br/>
201204
</div>
202205
</html>
203206
""", from: 'jenkins@ci.deis.io', subject: 'Workflow CLI E2E Test Failure', to: env.SLACKEMAIL, mimeType: 'text/html'
204-
}
205-
input "Retry the e2e tests?"
206207
}
208+
input "Retry the e2e tests?"
207209
}
208-
false
209210
}
210211
}

0 commit comments

Comments
 (0)