Changeset bd50205


Ignore:
Timestamp:
Jun 8, 2021, 9:22:55 PM (6 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
jacob/cs343-translation, master, new-ast-unique-expr
Children:
53d34343, cc5544a
Parents:
e018546
Message:

Jenkins email must run inside node

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/FullBuild

    re018546 rbd50205  
    144144//Email notification on a full build failure
    145145def promote_email(boolean success) {
    146         echo('notifying users')
     146        node {
     147                echo('notifying users')
    147148
    148         def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
     149                def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
    149150
    150         //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    151         //Configurations for email format
    152         def email_subject = "[cforall git][${result}]"
    153         def email_body = """<p>This is an automated email from the Jenkins build machine. It was
    154 generated following the result of the C\u2200 nightly build.</p>
     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>
    155156
    156 <p>Check console output at ${env.BUILD_URL} to view the results.</p>
     157        <p>Check console output at ${env.BUILD_URL} to view the results.</p>
    157158
    158 <p>- Status --------------------------------------------------------------</p>
     159        <p>- Status --------------------------------------------------------------</p>
    159160
    160 <p>${result}</p>
     161        <p>${result}</p>
    161162
    162 <p>- Performance ---------------------------------------------------------</p>
     163        <p>- Performance ---------------------------------------------------------</p>
    163164
    164 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
    165 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=1" >
     165        <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
     166        <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=1" >
    166167
    167 <p>- Logs ----------------------------------------------------------------</p>
    168 """
     168        <p>- Logs ----------------------------------------------------------------</p>
     169        """
    169170
    170         def email_to = "cforall@lists.uwaterloo.ca"
     171                def email_to = "cforall@lists.uwaterloo.ca"
    171172
    172         //send email notification
    173         emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
     173                //send email notification
     174                emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
     175        }
    174176}
  • Jenkinsfile

    re018546 rbd50205  
    226226//Standard build email notification
    227227def email(boolean log) {
    228         //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    229         //Configurations for email format
    230         echo 'Notifying users of result'
    231 
    232         def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    233         def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
    234         def email_body = """<p>This is an automated email from the Jenkins build machine. It was
    235 generated because of a git hooks/post-receive script following
    236 a ref change which was pushed to the C\u2200 repository.</p>
    237 """ + Tools.GitLogMessage()
    238 
    239         def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
    240 
    241         if( Settings && !Settings.Silent ) {
    242                 //send email notification
    243                 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
    244         } else {
    245                 echo "Would send email to: ${email_to}"
    246                 echo "With title: ${email_subject}"
    247                 echo "Content: \n${email_body}"
     228        node {
     229                //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
     230                //Configurations for email format
     231                echo 'Notifying users of result'
     232
     233                def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
     234                def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
     235                def email_body = """<p>This is an automated email from the Jenkins build machine. It was
     236        generated because of a git hooks/post-receive script following
     237        a ref change which was pushed to the C\u2200 repository.</p>
     238        """ + Tools.GitLogMessage()
     239
     240                def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
     241
     242                if( Settings && !Settings.Silent ) {
     243                        //send email notification
     244                        emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
     245                } else {
     246                        echo "Would send email to: ${email_to}"
     247                        echo "With title: ${email_subject}"
     248                        echo "Content: \n${email_body}"
     249                }
    248250        }
    249251}
Note: See TracChangeset for help on using the changeset viewer.