Changeset 7b1a604 for Jenkinsfile
- Timestamp:
- Jun 6, 2016, 12:22:50 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- ab60d6d
- Parents:
- de62f0f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
rde62f0f0 r7b1a604 74 74 status_prefix = '' 75 75 76 //Properties sent by the git-hooks (ref name, latest commit hash, previous commit hash) 77 // properties( [[$class: 'ParametersDefinitionProperty', parameterDefinitions: \ 78 // [[$class: 'StringParameterDefinition', name: 'GitRefName', defaultValue: 'master', description: 'name of the ref that changed' ], \ 79 // [$class: 'StringParameterDefinition', name: 'GitRefNewValue', defaultValue: 'HEAD', description: 'new commit of the reference' ], \ 80 // [$class: 'StringParameterDefinition', name: 'GitRefOldValue', defaultValue: 'HEAD~1', description: 'old commit of the reference']] \ 81 // ]] ) 76 try { 82 77 83 try {84 def out_dir = pwd tmp: true85 gitRefName = env.BRANCH_NAME86 dir("../${gitRefName}@script") {87 sh "git reflog > ${out_dir}/GIT_COMMIT"88 }89 git_reflog = readFile("${out_dir}/GIT_COMMIT")90 gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]91 gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]92 93 echo "Properties-start"94 echo "ref name : ${gitRefName}"95 echo "ref new value : ${gitRefNewValue}"96 echo "ref old value : ${gitRefOldValue}"97 echo "Properties-stop"98 78 99 79 //Prevent the build from exceeding 30 minutes … … 102 82 //Wrap build to add timestamp to command line 103 83 wrap([$class: 'TimestamperBuildWrapper']) { 84 85 collect_git_info() 104 86 105 87 //Compile using gcc-4.9 … … 145 127 } 146 128 129 def collect_git_info() { 130 131 def out_dir = pwd tmp: true 132 gitRefName = env.BRANCH_NAME 133 dir("../${gitRefName}@script") { 134 sh "git reflog > ${out_dir}/GIT_COMMIT" 135 } 136 git_reflog = readFile("${out_dir}/GIT_COMMIT") 137 gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1] 138 gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2] 139 } 140 147 141 //=========================================================================================================== 148 142 //Routine responsible of sending the email notification once the build is completed … … 153 147 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 154 148 149 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 150 def gitLog = readFile('GIT_LOG') 151 152 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 153 def gitDiff = readFile('GIT_DIFF') 154 155 155 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}" 156 156 def email_body = """This is an automated email from the Jenkins build machine. It was … … 160 160 161 161 The branch ${env.BRANCH_NAME} has been updated. 162 via ${gitRefOldValue} (commit) 163 from ${gitRefNewValue} (commit) 162 164 163 Check console output at ${env.BUILD_URL} to view the results. """165 Check console output at ${env.BUILD_URL} to view the results. 164 166 165 // def config = new File('/u/cforall/software/cfa/cfa-cc/config').text 166 // def email_to = (config =~ /mailinglist ?= ?(.+)/)[0][1] 167 - Status -------------------------------------------------------------- 168 169 BUILD# ${env.BUILD_NUMBER} - ${status} 170 171 - Log ----------------------------------------------------------------- 172 ${gitLog} 173 ----------------------------------------------------------------------- 174 Summary of changes: 175 ${gitDiff} 176 """ 177 167 178 def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com" 168 179
Note: See TracChangeset
for help on using the changeset viewer.