source: Jenkinsfile@ 1da4ead

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 1da4ead was 1da4ead, checked in by Thierry Delisle <tdelisle@…>, 10 years ago

added comments to jenkins file

  • Property mode set to 100644
File size: 1.4 KB
Line 
1
2
3//checkout the source code and clean the repo
4stage 'Checkout'
5node {
6 checkout scm
7 sh 'git clean -dfq'
8}
9
10
11stage 'Build'
12node ('master'){
13 try {
14 //configure the conpilation
15 //Don't remove outputs for the clean and configure unless errors are present
16 sh 'make clean > /dev/null'
17 sh 'CC=gcc-4.9 CXX=g++-4.9 ./configure > /dev/null'
18 sh 'make -j 8'
19 email("SUCCESS", false)
20
21 //something happen, this build is a failure
22 } catch (Exception e) {
23 email("FAILURE", true)
24 throw e;
25 }
26}
27
28def email(String status, boolean log) {
29 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
30 //Configurations for email format
31 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
32
33 def email_subject = "[${project_name} git] UNNAMED PROJECT branch ${env.BRANCH_NAME} - Build # ${env.BUILD_NUMBER} - ${status}!"
34 def email_body = """ This is an automated email from the Jenkins build machine. It was
35 generated because of a git hooks/post-receive script following
36 a ref change was pushed to the repository containing
37 the project "UNNAMED PROJECT".
38
39 The branch ${env.BRANCH_NAME} has been updated.
40
41 Check console output at ${env.BUILD_URL} to view the results."""
42
43 def config = new File('/u/cforall/software/cfa/cfa-cc/config').text
44 def email_to = (config =~ /mailinglist ?= ?(.+)/)[0][1]
45
46 //send email notification
47 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
48}
Note: See TracBrowser for help on using the repository browser.