@@ -10,7 +10,7 @@ def uniqueID
1010
1111stage(' Initialization' ) {
1212 node(' master' ) {
13- try {
13+ catchError( stageResult : ' FAILURE ' ) {
1414 uniqueID = " ${ env.ghprbActualCommit[0..6]} -${ env.BUILD_ID} "
1515 echo ' Environment Variables:'
1616 echo sh(script : ' env|sort' , returnStdout : true )
@@ -55,19 +55,7 @@ stage('Initialization') {
5555 currentBuild. result = ' ABORTED'
5656 return
5757 }
58-
5958 currentBuild. result = ' SUCCESS'
60- } catch (err) {
61- println err. toString()
62- if (err. toString(). contains(' exit code 143' )) {
63- currentBuild. result = " ABORTED"
64- }
65- else if (err. toString(). contains(' Queue task was cancelled' )) {
66- currentBuild. result = " ABORTED"
67- }
68- else {
69- currentBuild. result = " FAILURE"
70- }
7159 }
7260 }
7361}
@@ -101,22 +89,8 @@ stage('Unittest') {
10189 }
10290 }
10391
104- try {
92+ catchError( stageResult : ' FAILURE ' ) {
10593 parallel builds
106- currentBuild. result = " SUCCESS"
107- } catch (err) {
108- if (err. toString(). contains(' exit code 143' )) {
109- currentBuild. result = " ABORTED"
110- println " The Unittest was cancelled. Aborting....."
111- }
112- else if (err. toString(). contains(' Queue task was cancelled' )) {
113- currentBuild. result = " ABORTED"
114- println " The Queue task was cancelled. Aborting....."
115- }
116- else {
117- currentBuild. result = " FAILURE"
118- println " The Unittest failed. Exiting....."
119- }
12094 }
12195}
12296
@@ -127,7 +101,7 @@ stage('Tutorial Check') {
127101 return
128102 }
129103 else {
130- try {
104+ catchError( stageResult : ' FAILURE ' ) {
131105 if (! (' daint' in machinesToRun)) {
132106 return
133107 }
@@ -141,20 +115,6 @@ stage('Tutorial Check') {
141115 bash ${ reframeDir} /${ bashScript} -f ${ reframeDir} -i '' -t""" )
142116 }
143117 }
144- currentBuild. result = " SUCCESS"
145- } catch (err) {
146- if (err. toString(). contains(' exit code 143' )) {
147- currentBuild. result = " ABORTED"
148- println " The Tutorial Check was cancelled. Aborting....."
149- }
150- else if (err. toString(). contains(' Queue task was cancelled' )) {
151- currentBuild. result = " ABORTED"
152- println " The Queue task was cancelled. Aborting....."
153- }
154- else {
155- currentBuild. result = " FAILURE"
156- println " The Tutorial Check failed. Exiting....."
157- }
158118 }
159119 }
160120}
@@ -181,22 +141,8 @@ stage('Cleanup') {
181141 }
182142 }
183143 }
184- try {
144+ catchError( stageResult : ' FAILURE ' ) {
185145 parallel builds
186- currentBuild. result = " SUCCESS"
187- } catch (err) {
188- if (err. toString(). contains(' exit code 143' )) {
189- currentBuild. result = " ABORTED"
190- println " The Cleanup was cancelled. Aborting....."
191- }
192- else if (err. toString(). contains(' Queue task was cancelled' )) {
193- currentBuild. result = " ABORTED"
194- println " The Queue task was cancelled. Aborting....."
195- }
196- else {
197- currentBuild. result = " FAILURE"
198- println " The Cleanup failed. Exiting....."
199- }
200146 }
201147 }
202148}
@@ -218,21 +164,7 @@ stage('Cleanup Stale') {
218164 }
219165 }
220166
221- try {
167+ catchError( stageResult : ' FAILURE ' ) {
222168 parallel builds
223- currentBuild. result = " SUCCESS"
224- } catch (err) {
225- if (err. toString(). contains(' exit code 143' )) {
226- currentBuild. result = " ABORTED"
227- println " The Build step was cancelled. Aborting....."
228- }
229- else if (err. toString(). contains(' Queue task was cancelled' )) {
230- currentBuild. result = " ABORTED"
231- println " The Queue task was cancelled. Aborting....."
232- }
233- else {
234- currentBuild. result = " FAILURE"
235- println " The Build step failed. Exiting....."
236- }
237169 }
238170}
0 commit comments