source: Jenkinsfile@ ed091cd

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay gc_noraii jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since ed091cd was ed091cd, checked in by Thierry Delisle <tdelisle@…>, 10 years ago

email notification seems to work properly for jenkins

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[c9d651d]1
2
[7aebc62]3//clean the repo and checkout the source code
4stage 'Checkout'
5node {
[f2b977a]6 checkout scm
[23a14d86]7 sh 'git clean -f'
[7aebc62]8}
[23a14d86]9
[7aebc62]10
11stage 'Build'
12node ('master'){
[23a14d86]13 //configure the conpilation
[d3d0069]14 try {
[e8a22a7]15 sh 'git clean -dfq'
[d3d0069]16 sh 'make maintainer-clean > /dev/null'
[e8a22a7]17 sh 'CC=gcc-4.9 CXX=g++-4.9 ./configure > /dev/null'
[ed091cd]18 sh 'make -j 8'
[e8a22a7]19 email("SUCCESS")
[d3d0069]20 } catch (Exception e) {
[ed091cd]21 email("FAILURE")
[e8a22a7]22 throw e;
[d3d0069]23 }
[7aebc62]24}
[f2b977a]25
[e8a22a7]26def email(String status) {
27 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
28 //Configurations for email format
29 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
30
31 def email_subject = "[${project_name} git] - branch ${env.BRANCH_NAME} - Build # ${env.BUILD_NUMBER} - ${status}!"
[ed091cd]32 def email_body = """ This is an automated email from the Jenkins build machine. It was
[e8a22a7]33 generated because of a git hooks/post-receive script following
34 a ref change was pushed to the repository containing
35 the project "UNNAMED PROJECT".
36
[ed091cd]37 The branch ${env.BRANCH_NAME} has been updated.
[e8a22a7]38
39 Those revisions listed above that are new to this repository have
40 not appeared on any other notification email; so we list those
41 revisions in full, below.
42
43 Check console output at ${env.BUILD_URL} to view the results."""
44
45 def email_to = 'tdelisle@uwaterloo.ca'
46
47 //send email notification
48 emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
49}
Note: See TracBrowser for help on using the repository browser.