source: Jenkins/FullBuild@ 17e6e08

ADT ast-experimental pthread-emulation
Last change on this file since 17e6e08 was 9d2609fa, checked in by Thierry Delisle <tdelisle@…>, 3 years ago

Disabled x86 for nightly build until openssh issue is resolved

  • Property mode set to 100644
File size: 5.1 KB
RevLine 
[ae28ee2]1#!groovy
2
3//===========================================================================================================
4// Main loop of the compilation
5//===========================================================================================================
6
[5e64df8e]7node {
[ae28ee2]8 def err = null
9
[4af1021]10 final scmVars = checkout scm
11 final commitId = scmVars.GIT_COMMIT
[98168b9]12
[ae28ee2]13 try {
[f408e1a]14 //Wrap build to add timestamp to command line
15 wrap([$class: 'TimestamperBuildWrapper']) {
16
17 stage('Build') {
18
19 parallel (
[9d2609fa]20 // gcc_08_x86_new: { trigger_build( 'gcc-8', 'x86' ) },
21 // gcc_07_x86_new: { trigger_build( 'gcc-7', 'x86' ) },
22 // gcc_06_x86_new: { trigger_build( 'gcc-6', 'x86' ) },
[8110bc3]23 gcc_10_x64_new: { trigger_build( 'gcc-10', 'x64' ) },
24 gcc_09_x64_new: { trigger_build( 'gcc-9', 'x64' ) },
25 gcc_08_x64_new: { trigger_build( 'gcc-8', 'x64' ) },
26 gcc_07_x64_new: { trigger_build( 'gcc-7', 'x64' ) },
27 gcc_06_x64_new: { trigger_build( 'gcc-6', 'x64' ) },
28 clang_x64_new: { trigger_build( 'clang', 'x64' ) },
[f408e1a]29 )
[ae28ee2]30 }
[8089fde]31
32 stage('Package') {
[b19fdb9]33 trigger_dist( commitId, currentBuild.number.toString() )
[8089fde]34 }
[e9ea53d]35
36 stage('Promote') {
37 trigger_prom()
38 }
[ae28ee2]39 }
[13c98a4]40
41 promote_email(true)
[ae28ee2]42 }
43
44 //If an exception is caught we need to change the status and remember to
45 //attach the build log to the email
46 catch (Exception caughtError) {
47 echo('error caught')
48
49 //rethrow error later
50 err = caughtError
51
52 //Store the result of the build log
53 currentBuild.result = 'FAILURE'
54
55 //Send email to notify the failure
[13c98a4]56 promote_email(false)
[ae28ee2]57 }
58
59 finally {
60 //Must re-throw exception to propagate error
61 if (err) {
62 throw err
63 }
64 }
65}
66//===========================================================================================================
67// Main compilation routines
68//===========================================================================================================
69
[ef1d025d]70def trigger_build(String cc, String arch) {
[9eb7a532]71 // Randomly delay the builds by a random amount to avoid hitting the SC server to hard
72 sleep(time: 5 * Math.random(), unit:"MINUTES")
73
74 // Run the build
75 // Don't propagate, it doesn't play nice with our email setup
[ae28ee2]76 def result = build job: 'Cforall/master', \
77 parameters: [ \
[8fa3c7e6]78 [$class: 'StringParameterValue', \
[0c1d240]79 name: 'Compiler', \
[8fa3c7e6]80 value: cc], \
81 [$class: 'StringParameterValue', \
[0c1d240]82 name: 'Architecture', \
[8fa3c7e6]83 value: arch], \
[849de65]84 [$class: 'BooleanParameterValue', \
85 name: 'NewAST', \
[ef1d025d]86 value: true], \
[ae28ee2]87 [$class: 'BooleanParameterValue', \
[0c1d240]88 name: 'RunAllTests', \
[8fa3c7e6]89 value: true], \
90 [$class: 'BooleanParameterValue', \
[0c1d240]91 name: 'RunBenchmark', \
[8fa3c7e6]92 value: true], \
93 [$class: 'BooleanParameterValue', \
[0c1d240]94 name: 'BuildDocumentation', \
[8fa3c7e6]95 value: true], \
96 [$class: 'BooleanParameterValue', \
[0c1d240]97 name: 'Publish', \
[849de65]98 value: true], \
[8fa3c7e6]99 [$class: 'BooleanParameterValue', \
[0c1d240]100 name: 'Silent', \
[ae28ee2]101 value: true], \
102 ], \
103 propagate: false
104
105 echo(result.result)
106
107 if(result.result != 'SUCCESS') {
[cc5544a]108 sh("wget -q -O - https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/${result.number}/consoleText")
[ae28ee2]109 error(result.result)
110 }
111}
112
[6ae5c22]113def trigger_dist(String commitId, String buildNum) {
[b19fdb9]114 def result = build job: 'Cforall_Distribute_Ref', \
115 parameters: [ \
116 string(name: 'GitRef', value: commitId), \
[6ae5c22]117 string(name: 'Build' , value: buildNum) \
[587a608]118 ], \
119 propagate: false
[b19fdb9]120
121 echo(result.result)
122
123 if(result.result != 'SUCCESS') {
124 sh("wget -q -O - https://cforall.uwaterloo.ca/jenkins/job/Cforall_Distribute_Ref/${result.number}/consoleText")
125 error(result.result)
126 }
127}
128
[e9ea53d]129def trigger_prom() {
130 def result = build job: 'Cforall_Promote_Ref', propagate: false
131
132 echo(result.result)
133
134 if(result.result != 'SUCCESS') {
135 sh("wget -q -O - https://cforall.uwaterloo.ca/jenkins/job/Cforall_Promote_Ref/${result.number}/consoleText")
136 error(result.result)
137 }
138}
139
[ae28ee2]140//===========================================================================================================
141//Routine responsible of sending the email notification once the build is completed
142//===========================================================================================================
143
144//Email notification on a full build failure
[13c98a4]145def promote_email(boolean success) {
[bd50205]146 node {
147 echo('notifying users')
[ae28ee2]148
[bd50205]149 def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
[13c98a4]150
[bd50205]151 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
152 //Configurations for email format
153 def email_subject = "[cforall git][${result}]"
154 def email_body = """<p>This is an automated email from the Jenkins build machine. It was
155 generated following the result of the C\u2200 nightly build.</p>
[13c98a4]156
[bd50205]157 <p>Check console output at ${env.BUILD_URL} to view the results.</p>
[13c98a4]158
[bd50205]159 <p>- Status --------------------------------------------------------------</p>
[ae28ee2]160
[bd50205]161 <p>${result}</p>
[ae28ee2]162
[bd50205]163 <p>- Logs ----------------------------------------------------------------</p>
164 """
[ae28ee2]165
[bd50205]166 def email_to = "cforall@lists.uwaterloo.ca"
[ae28ee2]167
[bd50205]168 //send email notification
169 emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
170 }
[ae28ee2]171}
Note: See TracBrowser for help on using the repository browser.