Changeset a235d09 for Jenkinsfile


Ignore:
Timestamp:
Jun 8, 2016, 2:13:44 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8c8c2d9, 905cf4b
Parents:
c9986e8
Message:

Full Build should now properly promote to DoLang? git repo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rc9986e8 ra235d09  
    3333                //do a maintainer-clean to make sure we need to remake from scratch
    3434                sh 'make maintainer-clean > /dev/null'
     35}
     36
     37def push_build() {
     38        build_stage 'Push'
     39
     40                sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git'
     41                sh 'git push DoLang master'
    3542}
    3643
     
    120127                                cfa_build()
    121128
     129                                if(promote_build) {
     130                                        push_build()
     131                                }
    122132                        }
    123133                }
     
    139149        finally {
    140150                //Send email with final results
    141                 email(currentBuild.result, log_needed)
     151                notify_result(promote_build, err != null, currentBuild.result, log_needed)
    142152
    143153                /* Must re-throw exception to propagate error */
     
    151161//Routine responsible of sending the email notification once the build is completed
    152162//===========================================================================================================
     163def promote_email(boolean promote, boolean success, String status, boolean log) {
     164        if(promote)     {
     165                if( !success ) {
     166                        promote_email(status)
     167                }
     168        }
     169        else {
     170                email(status, log)
     171        }
     172}
     173
     174//Email notification on a full build failure
     175def promote_email(String status) {
     176        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
     177        //Configurations for email format
     178        def email_subject = "[cforall git][PROMOTE - FAILURE]"
     179        def email_body = """This is an automated email from the Jenkins build machine. It was
     180generated because of a git hooks/post-receive script following
     181a ref change was pushed to the repository containing
     182the project "UNNAMED PROJECT".
     183
     184Check console output at ${env.BUILD_URL} to view the results.
     185
     186- Status --------------------------------------------------------------
     187
     188PROMOTE FAILURE - ${status}
     189"""
     190
     191        def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com"
     192
     193        //send email notification
     194        emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
     195}
     196
     197//Standard build email notification
    153198def email(String status, boolean log) {
    154199        //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
     
    156201        def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    157202
    158         sh "git rev-list --format=short ${gitRefOldValue}..${gitRefNewValue} > GIT_LOG"
     203        sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
    159204        def gitLog = readFile('GIT_LOG')
    160205
     
    169214
    170215The branch ${env.BRANCH_NAME} has been updated.
    171         via  ${gitRefOldValue} (commit)
    172         from  ${gitRefNewValue} (commit)
     216  via  ${gitRefOldValue} (commit)
     217  from  ${gitRefNewValue} (commit)
    173218
    174219Check console output at ${env.BUILD_URL} to view the results.
Note: See TracChangeset for help on using the changeset viewer.