Index: Jenkins/FullBuild =================================================================== --- Jenkins/FullBuild (revision 0c1d2403885f5c3b07ea42809effc74e475e97ad) +++ Jenkins/FullBuild (revision 38c0fe51443f6890fb324c7ef08793dd9642d39b) @@ -25,8 +25,7 @@ ) } + } - //Push latest changes to do-lang repo - push_build() - } + promote_email(true) } @@ -43,5 +42,5 @@ //Send email to notify the failure - promote_failure_email() + promote_email(false) } @@ -92,32 +91,4 @@ } -def push_build() { - //Don't use the build_stage function which outputs the compiler - stage('Push') { - - status_prefix = 'Push' - - def out_dir = pwd tmp: true - sh "mkdir -p ${out_dir}" - - //checkout the code to make sure this is a valid git repo - checkout scm - - collect_git_info() - - //parse git logs to find what changed - sh "git remote > ${out_dir}/GIT_REMOTE" - git_remote = readFile("${out_dir}/GIT_REMOTE") - remoteDoLangExists = git_remote.contains("DoLang") - - if( !remoteDoLangExists ) { - sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git' - } - - //sh "GIT_SSH_COMMAND=\"ssh -v\" git push DoLang ${gitRefNewValue}:master" - echo('BUILD NOT PUSH SINCE DO-LANG SERVER WAS DOWN') - } -} - //Helper routine to collect information about the git history def collect_git_info() { @@ -141,20 +112,24 @@ //Email notification on a full build failure -def promote_failure_email() { +def promote_email(boolean success) { echo('notifying users') + + def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE" //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line //Configurations for email format - def email_subject = "[cforall git][PROMOTE - FAILURE]" - def email_body = """This is an automated email from the Jenkins build machine. It was -generated because of a git hooks/post-receive script following -a ref change was pushed to the repository containing -the project "UNNAMED PROJECT". + def email_subject = "[cforall git][${result}]" + def email_body = """
This is an automated email from the Jenkins build machine. It was +generated following the result of the C∀ nightly build.
-Check console output at ${env.BUILD_URL} to view the results. +Check console output at ${env.BUILD_URL} to view the results.
-- Status -------------------------------------------------------------- +- Status --------------------------------------------------------------
-PROMOTE FAILURE +${result}
+ +- Performance --------------------------------------------------------------
+ + """ @@ -162,4 +137,4 @@ //send email notification - emailext body: email_body, subject: email_subject, to: email_to, attachLog: true + emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success }