Changeset fde808df


Ignore:
Timestamp:
May 31, 2016, 11:04:53 AM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1e44b60
Parents:
f43a200
Message:

refactored Jenkinsfile to be more readable and fixed tests (maybe)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rf43a200 rfde808df  
    11
    22
    3 //checkout the source code and clean the repo
    4 stage 'Checkout'
    5 node {
    6         checkout scm
    7         sh 'git clean -dfq'
    8 }
     3node ('master'){
    94
     5        def err = null
     6        def stage_name
     7        def log_needed = false
     8        currentBuild.result = "SUCCESS"
    109
    11 stage 'Build'
    12 node ('master'){
    1310        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'
    1911
    20         //something happen, this build is a failure
    21         } catch (Exception e) {
    22                 email("COMPILATION FAILURE", true)
    23                 throw e;
     12                stage 'Checkout'
     13
     14                        //checkout the source code and clean the repo
     15                        checkout scm
     16                        sh 'git clean -dfq'
     17
     18                stage 'Build'
     19
     20                        stage_name = 'Build'
     21
     22                        //configure the conpilation
     23                        //Don't remove outputs for the clean and configure unless errors are present
     24                        sh 'make clean > /dev/null'
     25                        sh 'CC=gcc-4.9 CXX=g++-4.9 ./configure > /dev/null'
     26                        sh 'make -j 8'
     27
     28                stage 'Test'
     29
     30                        stage_name = 'Test'
     31
     32                        dir ('src/example') {
     33                                sh './runTests.sh'
     34                        }
     35
     36                stage 'Cleanup'
     37
     38                        email("SUCCESS", false)
    2439        }
    25 }
    2640
    27 stage 'Test'
    28 node ('master'){
    29         try {
    30                 dir 'src/example'
    31                 sh './runTests.sh'
    32                 dir '../..'
    33                 email("SUCCESS", false)
    34         //something happen, this build is a failure
    35         } catch (Exception e) {
    36                 email("TEST FAILURE", true)
    37                 throw e;
     41        catch (Exception caughtError) {
     42                err = caughtError
     43
     44                switch(stage) {
     45                        case 'Test' :
     46                                currentBuild.result = "TEST FAILURE"
     47                                break
     48                        default :
     49                                currentBuild.result = "FAILURE"
     50                                break
     51                }
     52        }
     53
     54        finally {
     55                //Send email with final results
     56                email(currentBuild.result, log_needed)
     57
     58                /* Must re-throw exception to propagate error */
     59                if (err) {
     60                        throw err
     61                }
    3862        }
    3963}
Note: See TracChangeset for help on using the changeset viewer.