source: Jenkinsfile @ 71b7843

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 71b7843 was 71b7843, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

added support for reusing git mailing list in jenkins

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