Changeset 13c98a4 for Jenkins


Ignore:
Timestamp:
Apr 24, 2019, 3:14:32 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3c40dc2a
Parents:
f85464da
Message:

Jenkins emails now use html, this push does some work to improve how they look

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/FullBuild

    rf85464da r13c98a4  
    2727
    2828                        //Push latest changes to do-lang repo
    29                         push_build()
     29                        // push_build()
    3030                }
     31
     32                promote_email(true)
    3133        }
    3234
     
    4345
    4446                //Send email to notify the failure
    45                 promote_failure_email()
     47                promote_email(false)
    4648        }
    4749
     
    9294}
    9395
    94 def push_build() {
    95         //Don't use the build_stage function which outputs the compiler
    96         stage('Push') {
     96// def push_build() {
     97//      //Don't use the build_stage function which outputs the compiler
     98//      stage('Push') {
    9799
    98                 status_prefix = 'Push'
     100//              status_prefix = 'Push'
    99101
    100                 def out_dir = pwd tmp: true
    101                 sh "mkdir -p ${out_dir}"
     102//              def out_dir = pwd tmp: true
     103//              sh "mkdir -p ${out_dir}"
    102104
    103                 //checkout the code to make sure this is a valid git repo
    104                 checkout scm
     105//              //checkout the code to make sure this is a valid git repo
     106//              checkout scm
    105107
    106                 collect_git_info()
     108//              collect_git_info()
    107109
    108                 //parse git logs to find what changed
    109                 sh "git remote > ${out_dir}/GIT_REMOTE"
    110                 git_remote = readFile("${out_dir}/GIT_REMOTE")
    111                 remoteDoLangExists = git_remote.contains("DoLang")
     110//              //parse git logs to find what changed
     111//              sh "git remote > ${out_dir}/GIT_REMOTE"
     112//              git_remote = readFile("${out_dir}/GIT_REMOTE")
     113//              remoteDoLangExists = git_remote.contains("DoLang")
    112114
    113                 if( !remoteDoLangExists ) {
    114                         sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'
    115                 }
     115//              if( !remoteDoLangExists ) {
     116//                      sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'
     117//              }
    116118
    117                 //sh "GIT_SSH_COMMAND=\"ssh -v\" git push DoLang ${gitRefNewValue}:master"
    118                 echo('BUILD NOT PUSH SINCE DO-LANG SERVER WAS DOWN')
    119         }
    120 }
     119//              //sh "GIT_SSH_COMMAND=\"ssh -v\" git push DoLang ${gitRefNewValue}:master"
     120//              echo('BUILD NOT PUSH SINCE DO-LANG SERVER WAS DOWN')
     121//      }
     122// }
    121123
    122124//Helper routine to collect information about the git history
     
    141143
    142144//Email notification on a full build failure
    143 def promote_failure_email() {
     145def promote_email(boolean success) {
    144146        echo('notifying users')
     147
     148        def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
    145149
    146150        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    147151        //Configurations for email format
    148         def email_subject = "[cforall git][PROMOTE - FAILURE]"
    149         def email_body = """This is an automated email from the Jenkins build machine. It was
    150 generated because of a git hooks/post-receive script following
    151 a ref change was pushed to the repository containing
    152 the project "UNNAMED PROJECT".
     152        def email_subject = "[cforall git][${result}]"
     153        def email_body = """<p>This is an automated email from the Jenkins build machine. It was
     154generated following the result of the C∀ nightly build.</p>
    153155
    154 Check console output at ${env.BUILD_URL} to view the results.
     156<p>Check console output at ${env.BUILD_URL} to view the results.</p>
    155157
    156 - Status --------------------------------------------------------------
     158<p>- Status --------------------------------------------------------------</p>
    157159
    158 PROMOTE FAILURE
     160<p>${result}</p>
     161
     162<p>- Performance --------------------------------------------------------------</p>
     163
     164<img src="https://cforall.uwaterloo.ca/jenkins/view/all/job/Plot%20Plugin%20Test/plot/getPlot?index=0" >
    159165"""
    160166
     
    162168
    163169        //send email notification
    164         emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
     170        emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
    165171}
Note: See TracChangeset for help on using the changeset viewer.