source: Jenkins/FullBuild@ a2f86e9

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since a2f86e9 was a2f86e9, checked in by Thierry Delisle <tdelisle@…>, 9 years ago

fixed other mistake in full build jenkins full build script

  • Property mode set to 100644
File size: 4.0 KB
RevLine 
[1b8c156]1#!groovy
2
[6003581]3//===========================================================================================================
4// Main compilation routines
5//===========================================================================================================
[1b8c156]6def push_build() {
7 //Don't use the build_stage function which outputs the compiler
8 stage 'Push'
9
10 status_prefix = 'Push'
11
12 def out_dir = pwd tmp: true
13 sh "mkdir -p ${out_dir}"
14
15 //parse git logs to find what changed
16 sh "git remote > ${out_dir}/GIT_REMOTE"
17 git_remote = readFile("${out_dir}/GIT_REMOTE")
18 remoteDoLangExists = git_remote.contains("DoLang")
19
20 if( !remoteDoLangExists ) {
21 sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'
22 }
23
24 sh "git push DoLang ${gitRefNewValue}:master"
25}
26
[6003581]27//===========================================================================================================
28// Main loop of the compilation
29//===========================================================================================================
[121f499]30
[ad5b73e]31node ('master') {
32 try {
33 //Prevent the build from exceeding 30 minutes
34 timeout(60) {
35
36 //Wrap build to add timestamp to command line
37 wrap([$class: 'TimestamperBuildWrapper']) {
38
39 stage 'Build'
40
41 results = [null, null]
42
43 parallel (
44 x64: {
[a2f86e9]45 results[0] = build job: 'Cforall/master', \
[ad5b73e]46 parameters: [ \
47 [$class: 'BooleanParameterValue', \
48 name: 'isFullBuild', \
49 value: true], \
50 [$class: 'StringParameterValue', \
51 name: 'buildArchitecture', \
52 value: '64-bit'] \
53 ]
54 },
55 x32:
56 {
[a2f86e9]57 results[1] = build job: 'Cforall/master', \
[ad5b73e]58 parameters: [ \
59 [$class: 'BooleanParameterValue', \
60 name: 'isFullBuild', \
61 value: true], \
62 [$class: 'StringParameterValue', \
63 name: 'buildArchitecture', \
64 value: '32-bit'] \
65 ]
66 }
67 )
68
69 results.each { result ->
70 echo(result.result)
71 echo(result.absoluteUrl)
72
73 if (result.result != 'SUCCESS') {
[121f499]74 echo( 'Build Succede' )
[ad5b73e]75 }
[18a1419]76 }
77
[ad5b73e]78 //Push latest changes to do-lang repo
79 push_build()
80 }
[6003581]81 }
82 }
83
[121f499]84 //If an exception is caught we need to change the status and remember to
85 //attach the build log to the email
86 catch (Exception caughtError) {
87 //rethrow error later
88 err = caughtError
[6003581]89
[121f499]90 //Store the result of the build log
91 currentBuild.result = "${status_prefix} FAILURE".trim()
[6003581]92
[121f499]93 //Send email to notify the failure
94 promote_email(currentBuild.result)
[6003581]95 }
96
[121f499]97 finally {
98 //Must re-throw exception to propagate error
99 if (err) {
100 throw err
101 }
102 }
103}
[6003581]104//===========================================================================================================
105//Routine responsible of sending the email notification once the build is completed
106//===========================================================================================================
[1b8c156]107
108//Email notification on a full build failure
109def promote_email(String status) {
110 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
111 //Configurations for email format
112 def email_subject = "[cforall git][PROMOTE - FAILURE]"
113 def email_body = """This is an automated email from the Jenkins build machine. It was
114generated because of a git hooks/post-receive script following
115a ref change was pushed to the repository containing
116the project "UNNAMED PROJECT".
117
118Check console output at ${env.BUILD_URL} to view the results.
119
120- Status --------------------------------------------------------------
121
122PROMOTE FAILURE - ${status}
123"""
124
125 def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com"
126
127 //send email notification
128 emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
129}
Note: See TracBrowser for help on using the repository browser.