Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/FullBuild

    r0c1d240 r38c0fe5  
    2525                                )
    2626                        }
     27                }
    2728
    28                         //Push latest changes to do-lang repo
    29                         push_build()
    30                 }
     29                promote_email(true)
    3130        }
    3231
     
    4342
    4443                //Send email to notify the failure
    45                 promote_failure_email()
     44                promote_email(false)
    4645        }
    4746
     
    9291}
    9392
    94 def push_build() {
    95         //Don't use the build_stage function which outputs the compiler
    96         stage('Push') {
    97 
    98                 status_prefix = 'Push'
    99 
    100                 def out_dir = pwd tmp: true
    101                 sh "mkdir -p ${out_dir}"
    102 
    103                 //checkout the code to make sure this is a valid git repo
    104                 checkout scm
    105 
    106                 collect_git_info()
    107 
    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")
    112 
    113                 if( !remoteDoLangExists ) {
    114                         sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'
    115                 }
    116 
    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 }
    121 
    12293//Helper routine to collect information about the git history
    12394def collect_git_info() {
     
    141112
    142113//Email notification on a full build failure
    143 def promote_failure_email() {
     114def promote_email(boolean success) {
    144115        echo('notifying users')
     116
     117        def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
    145118
    146119        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    147120        //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".
     121        def email_subject = "[cforall git][${result}]"
     122        def email_body = """<p>This is an automated email from the Jenkins build machine. It was
     123generated following the result of the C∀ nightly build.</p>
    153124
    154 Check console output at ${env.BUILD_URL} to view the results.
     125<p>Check console output at ${env.BUILD_URL} to view the results.</p>
    155126
    156 - Status --------------------------------------------------------------
     127<p>- Status --------------------------------------------------------------</p>
    157128
    158 PROMOTE FAILURE
     129<p>${result}</p>
     130
     131<p>- Performance --------------------------------------------------------------</p>
     132
     133<img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
    159134"""
    160135
     
    162137
    163138        //send email notification
    164         emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
     139        emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
    165140}
Note: See TracChangeset for help on using the changeset viewer.