Changeset 685a5e8 for Jenkinsfile
- Timestamp:
- Jun 7, 2016, 11:27:55 AM (9 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:
- db175c8
- Parents:
- 2f6b7c9 (diff), d5f1cfc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r2f6b7c9 r685a5e8 64 64 } 65 65 66 //Helper routine to collect information about the git history 67 def collect_git_info() { 68 69 def out_dir = pwd tmp: true 70 gitRefName = env.BRANCH_NAME 71 dir("../${gitRefName}@script") { 72 sh "git reflog > ${out_dir}/GIT_COMMIT" 73 } 74 git_reflog = readFile("${out_dir}/GIT_COMMIT") 75 gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1] 76 gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2] 77 } 78 66 79 //=========================================================================================================== 67 80 // Main loop of the compilation … … 72 85 def log_needed = false 73 86 currentBuild.result = "SUCCESS" 74 75 //Properties sent by the git-hooks (ref name, latest commit hash, previous commit hash) 76 properties( [[$class: 'ParametersDefinitionProperty', parameterDefinitions: \ 77 [[$class: 'StringParameterDefinition', name: 'GitRefName', defaultValue: 'master', description: 'name of the ref that changed' ], \ 78 [$class: 'StringParameterDefinition', name: 'GitRefNewValue', defaultValue: 'HEAD', description: 'new commit of the reference' ], \ 79 [$class: 'StringParameterDefinition', name: 'GitRefOldValue', defaultValue: 'HEAD~1', description: 'old commit of the reference']] \ 80 ]] ) 87 status_prefix = '' 81 88 82 89 try { 83 echo "Properties-start"84 echo "ref name : ${GitRefName}"85 echo "ref new value : ${GitRefNewValue}"86 echo "ref old value : ${GitRefOldValue}"87 echo "Properties-stop"88 89 90 //Prevent the build from exceeding 30 minutes 90 91 timeout(30) { … … 92 93 //Wrap build to add timestamp to command line 93 94 wrap([$class: 'TimestamperBuildWrapper']) { 95 96 collect_git_info() 94 97 95 98 //Compile using gcc-4.9 … … 107 110 } 108 111 } 109 110 112 } 111 113 … … 142 144 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 143 145 146 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG" 147 def gitLog = readFile('GIT_LOG') 148 149 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF" 150 def gitDiff = readFile('GIT_DIFF') 151 144 152 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}" 145 153 def email_body = """This is an automated email from the Jenkins build machine. It was … … 149 157 150 158 The branch ${env.BRANCH_NAME} has been updated. 159 via ${gitRefOldValue} (commit) 160 from ${gitRefNewValue} (commit) 151 161 152 Check console output at ${env.BUILD_URL} to view the results. """162 Check console output at ${env.BUILD_URL} to view the results. 153 163 154 // def config = new File('/u/cforall/software/cfa/cfa-cc/config').text 155 // def email_to = (config =~ /mailinglist ?= ?(.+)/)[0][1] 164 - Status -------------------------------------------------------------- 165 166 BUILD# ${env.BUILD_NUMBER} - ${status} 167 168 - Log ----------------------------------------------------------------- 169 ${gitLog} 170 ----------------------------------------------------------------------- 171 Summary of changes: 172 ${gitDiff} 173 """ 174 156 175 def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com" 157 176
Note:
See TracChangeset
for help on using the changeset viewer.