source: Jenkins/FullBuild @ ad5b73e

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since ad5b73e was ad5b73e, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

added missing node statement in jenkins fullbuild 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//===========================================================================================================
[ad5b73e]30node ('master') {
31        try {
32                //Prevent the build from exceeding 30 minutes
33                timeout(60) {
34
35                        //Wrap build to add timestamp to command line
36                        wrap([$class: 'TimestamperBuildWrapper']) {
37
38                                stage 'Build'
39
40                                        results = [null, null]
41
42                                        parallel (
43                                                x64: {
44                                                        result[0] = build job: 'Cforall/master',                                        \
45                                                                parameters: [                                           \
46                                                                        [$class: 'BooleanParameterValue',               \
47                                                                          name: 'isFullBuild',                          \
48                                                                          value: true],                                         \
49                                                                        [$class: 'StringParameterValue',                \
50                                                                          name: 'buildArchitecture',                    \
51                                                                          value: '64-bit']                              \
52                                                                ]
53                                                },
54                                                x32:
55                                                 {
56                                                        result[1] = build job: 'Cforall/master',                                        \
57                                                                parameters: [                                           \
58                                                                        [$class: 'BooleanParameterValue',               \
59                                                                          name: 'isFullBuild',                          \
60                                                                          value: true],                                         \
61                                                                        [$class: 'StringParameterValue',                \
62                                                                          name: 'buildArchitecture',                    \
63                                                                          value: '32-bit']                              \
64                                                                ]
65                                                }
66                                        )
67
68                                        results.each { result ->
69                                                echo(result.result)
70                                                echo(result.absoluteUrl)
71
72                                                if (result.result != 'SUCCESS') {
73                                                        echo( 'Build Succeded' )
74                                                }
[18a1419]75                                        }
76
[ad5b73e]77                                //Push latest changes to do-lang repo
78                                push_build()
79                        }
[6003581]80                }
81        }
[18a1419]82}
83//If an exception is caught we need to change the status and remember to
84//attach the build log to the email
85catch (Exception caughtError) {
86        //rethrow error later
87        err = caughtError
[6003581]88
[18a1419]89        //Store the result of the build log
90        currentBuild.result = "${status_prefix} FAILURE".trim()
[6003581]91
[18a1419]92        //Send email to notify the failure
93        promote_email(currentBuild.result)
94}
[6003581]95
[18a1419]96finally {
97        //Must re-throw exception to propagate error
98        if (err) {
99                throw err
[6003581]100        }
101}
102
103//===========================================================================================================
104//Routine responsible of sending the email notification once the build is completed
105//===========================================================================================================
[1b8c156]106
107//Email notification on a full build failure
108def promote_email(String status) {
109        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
110        //Configurations for email format
111        def email_subject = "[cforall git][PROMOTE - FAILURE]"
112        def email_body = """This is an automated email from the Jenkins build machine. It was
113generated because of a git hooks/post-receive script following
114a ref change was pushed to the repository containing
115the project "UNNAMED PROJECT".
116
117Check console output at ${env.BUILD_URL} to view the results.
118
119- Status --------------------------------------------------------------
120
121PROMOTE FAILURE - ${status}
122"""
123
124        def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com"
125
126        //send email notification
127        emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
128}
Note: See TracBrowser for help on using the repository browser.