| [c9d651d] | 1 |
|
|---|
| 2 | //Configurations for email format
|
|---|
| [f2b977a] | 3 | def email_subject_template = '[$PROJECT_NAME git] - branch $GIT_BRANCH - Build # $BUILD_NUMBER - $BUILD_STATUS!'
|
|---|
| 4 | def email_body_template = '''This is an automated email from the Jenkins build machine. It was
|
|---|
| [c9d651d] | 5 | generated because of a git hooks/post-receive script following
|
|---|
| 6 | a ref change was pushed to the repository containing
|
|---|
| 7 | the project "UNNAMED PROJECT".
|
|---|
| 8 |
|
|---|
| 9 | The branch $GIT_BRANCH has been updated
|
|---|
| 10 | via $GIT_COMMIT (commit)
|
|---|
| 11 | from $GIT_PREVIOUS_COMMIT (commit)
|
|---|
| 12 |
|
|---|
| 13 | Those revisions listed above that are new to this repository have
|
|---|
| 14 | not appeared on any other notification email; so we list those
|
|---|
| 15 | revisions in full, below.
|
|---|
| 16 |
|
|---|
| 17 | Check console output at $BUILD_URL to view the results.'''
|
|---|
| 18 |
|
|---|
| [725f36f5] | 19 | node ('master'){
|
|---|
| [f2b977a] | 20 | //clean the repo and checkout the source code
|
|---|
| [23a14d86] | 21 | stage 'Stage Checkout'
|
|---|
| [f2b977a] | 22 | checkout scm
|
|---|
| [23a14d86] | 23 | sh 'git clean -f'
|
|---|
| 24 |
|
|---|
| 25 | //configure the conpilation
|
|---|
| 26 | stage 'Stage Build'
|
|---|
| 27 | sh 'dfjgh'
|
|---|
| 28 | sh 'make maintainer-clean'
|
|---|
| 29 | sh 'CC=gcc-4.9 CXX=g++-4.9 ./configure'
|
|---|
| 30 | sh 'make -j 8'
|
|---|
| [f2b977a] | 31 |
|
|---|
| [23a14d86] | 32 |
|
|---|
| 33 | stage 'Stage Notify'
|
|---|
| [a3f9946] | 34 |
|
|---|
| 35 | //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
|
|---|
| [23a14d86] | 36 | //Configurations for email format
|
|---|
| [a3f9946] | 37 | def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1]
|
|---|
| 38 |
|
|---|
| 39 | def email_subject = "[${project_name} git] - branch ${env.BRANCH_NAME} - Build # ${env.BUILD_NUMBER} - BUILD_STATUS!"
|
|---|
| 40 | def email_body = """This is an automated email from the Jenkins build machine. It was
|
|---|
| 41 | generated because of a git hooks/post-receive script following
|
|---|
| 42 | a ref change was pushed to the repository containing
|
|---|
| 43 | the project "UNNAMED PROJECT".
|
|---|
| 44 |
|
|---|
| 45 | The branch ${env.BRANCH_NAME} has been updated
|
|---|
| 46 | via GIT_COMMIT (commit)
|
|---|
| 47 | from GIT_PREVIOUS_COMMIT (commit)
|
|---|
| 48 |
|
|---|
| 49 | Those revisions listed above that are new to this repository have
|
|---|
| 50 | not appeared on any other notification email; so we list those
|
|---|
| 51 | revisions in full, below.
|
|---|
| 52 |
|
|---|
| 53 | Check console output at ${env.BUILD_URL} to view the results."""
|
|---|
| [3410c12] | 54 |
|
|---|
| [63fe9f1d] | 55 | def email_to = 'tdelisle@uwaterloo.ca'
|
|---|
| 56 |
|
|---|
| [f2b977a] | 57 | //send email notification
|
|---|
| [d42fa1f] | 58 | emailext body: email_body, subject: email_subject, to: email_to, attachLog: true
|
|---|
| [aad5a48] | 59 | }
|
|---|