
//Configurations for email format
def email_subject = '[$PROJECT_NAME git] - branch $GIT_BRANCH - Build # $BUILD_NUMBER - $BUILD_STATUS!'
def email_body = '''This is an automated email from the Jenkins build machine. It was
generated because of a git hooks/post-receive script following
a ref change was pushed to the repository containing
the project "UNNAMED PROJECT".

The branch $GIT_BRANCH has been updated
       via  $GIT_COMMIT (commit)
      from  $GIT_PREVIOUS_COMMIT (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

Check console output at $BUILD_URL to view the results.'''

node ('master'){
  stage 'Build'
  checkout scm //checkout the source code from source control
  sh 'CC=gcc-4.9 CXX=g++-4.9 ./configure'
  sh 'make -j 8'
  emailext body: email_body, subject: email_subject, to: 'tdelisle@uwaterloo.ca'
 }
