Changes in Jenkinsfile [0961bf4:3831b58]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r0961bf4 r3831b58 28 28 wrap([$class: 'TimestamperBuildWrapper']) { 29 29 30 notify_server() 31 32 prepare_build() 33 34 checkout() 35 36 build() 37 38 test() 39 40 benchmark() 41 42 clean() 43 44 build_doc() 45 46 publish() 47 48 notify_server() 30 //Prevent the build from exceeding 60 minutes 31 timeout(60) { 32 33 notify_server() 34 35 prepare_build() 36 37 checkout() 38 39 build() 40 41 test() 42 43 benchmark() 44 45 clean() 46 47 build_doc() 48 49 publish() 50 51 notify_server() 52 } 49 53 } 50 54 } … … 85 89 def collect_git_info() { 86 90 87 checkout scm88 89 91 //create the temporary output directory in case it doesn't already exist 90 92 def out_dir = pwd tmp: true … … 93 95 //parse git logs to find what changed 94 96 gitRefName = env.BRANCH_NAME 95 sh "git reflog > ${out_dir}/GIT_COMMIT" 97 dir("../${gitRefName}@script") { 98 sh "git reflog > ${out_dir}/GIT_COMMIT" 99 } 96 100 git_reflog = readFile("${out_dir}/GIT_COMMIT") 97 101 gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1] … … 166 170 } 167 171 168 def build_stage(String name , Closure block) {172 def build_stage(String name) { 169 173 stage_name = name 170 stage (name, block)174 stage name 171 175 } 172 176 … … 241 245 //Compilation script is done here but environnement set-up and error handling is done in main loop 242 246 def checkout() { 243 build_stage ('Checkout') {247 build_stage'Checkout' 244 248 //checkout the source code and clean the repo 245 249 checkout scm … … 250 254 //Reset the git repo so no local changes persist 251 255 sh 'git reset --hard' 252 }253 256 } 254 257 255 258 def build() { 256 build_stage ('Build') {259 build_stage'Build' 257 260 258 261 def install_dir = pwd tmp: true … … 266 269 //Compile the project 267 270 sh 'make -j 8 --no-print-directory V=0 install' 268 }269 271 } 270 272 271 273 def test() { 272 build_stage ('Test') {274 build_stage'Test' 273 275 274 276 //Run the tests from the tests directory 275 277 if ( do_alltests ) { 276 sh 'make -C src/tests all-tests debug=yes --no-print-directory'277 sh 'make -C src/tests all-tests debug=no --no-print-directory'278 sh 'make -C src/tests all-tests debug=yes' 279 sh 'make -C src/tests all-tests debug=no' 278 280 } 279 281 else { 280 sh 'make -C src/tests --no-print-directory' 281 } 282 } 282 sh 'make -C src/tests' 283 } 283 284 } 284 285 285 286 def benchmark() { 286 build_stage ('Benchmark') {287 build_stage'Benchmark' 287 288 288 289 if( !do_benchmark ) return … … 293 294 //Append bench results 294 295 sh 'make -C src/benchmark --no-print-directory csv-data >> bench.csv' 295 }296 296 } 297 297 298 298 def clean() { 299 build_stage ('Cleanup') {299 build_stage'Cleanup' 300 300 301 301 //do a maintainer-clean to make sure we need to remake from scratch 302 302 sh 'make maintainer-clean > /dev/null' 303 }304 303 } 305 304 306 305 def build_doc() { 307 build_stage ('Documentation') {306 build_stage'Documentation' 308 307 309 308 if( !do_doc ) return … … 316 315 make_doc() 317 316 } 318 }319 317 } 320 318 321 319 def publish() { 322 build_stage ('Publish') {320 build_stage'Publish' 323 321 324 322 if( !do_publish ) return … … 326 324 //Then publish the results 327 325 sh 'curl --silent --data @bench.csv http://plg2:8082/jenkins/publish > /dev/null || true' 328 }329 326 } 330 327 … … 374 371 """ 375 372 376 def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com , ajbeach@edu.uwaterloo.ca"373 def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com" 377 374 378 375 //send email notification
Note: See TracChangeset
for help on using the changeset viewer.