Skip to content

Commit e120b97

Browse files
fix(CI): throw instead of return false on error (#66)
1 parent 676f316 commit e120b97

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def make = { String target ->
55
sh "make ${target} fileperms"
66
} catch(error) {
77
sh 'make fileperms'
8-
false
8+
throw error
99
}
1010
}
1111

@@ -125,7 +125,7 @@ node('linux') {
125125
sh(gcs_cmd + cmd)
126126
} catch(error) {
127127
sh(gcs_cmd + gcs_cleanup_cmd)
128-
error 'gcs error'
128+
throw error
129129
}
130130
}
131131

@@ -175,10 +175,13 @@ waitUntil {
175175
build job: downstreamJob, parameters: [[$class: 'StringParameterValue', name: 'WORKFLOW_CLI_SHA', value: git_commit]]
176176
true
177177
} catch(error) {
178-
node('linux') {
179-
if (git_branch != "remotes/origin/master") {
180-
withCredentials([[$class: 'StringBinding', credentialsId: '8a727911-596f-4057-97c2-b9e23de5268d', variable: 'SLACKEMAIL']]) {
181-
mail body: """<!DOCTYPE html>
178+
if (git_branch == "remotes/origin/master") {
179+
throw error
180+
}
181+
182+
node('linux') {
183+
withCredentials([[$class: 'StringBinding', credentialsId: '8a727911-596f-4057-97c2-b9e23de5268d', variable: 'SLACKEMAIL']]) {
184+
mail body: """<!DOCTYPE html>
182185
<html>
183186
<head>
184187
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
@@ -192,10 +195,9 @@ Commit: ${env.CHANGE_TITLE}<br/>
192195
</div>
193196
</html>
194197
""", from: 'jenkins@ci.deis.io', subject: 'Controller-sdk-go E2E Test Failure', to: env.SLACKEMAIL, mimeType: 'text/html'
195-
}
196-
input "Retry the e2e tests?"
197-
}
198198
}
199+
input "Retry the e2e tests?"
200+
}
199201
false
200202
}
201203
}

0 commit comments

Comments
 (0)