Changeset f1ee72e for Jenkinsfile


Ignore:
Timestamp:
Jun 23, 2016, 12:23:00 PM (10 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
4d3ca1d8
Parents:
c2931ea (diff), d56c05d0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rc2931ea rf1ee72e  
    55//===========================================================================================================
    66//Compilation script is done here but environnement set-up and error handling is done in main loop
    7 def cfa_build() {
     7def cfa_build(boolean full_build) {
    88        build_stage 'Checkout'
    99                def install_dir = pwd tmp: true
    1010                //checkout the source code and clean the repo
    1111                checkout scm
     12
     13                //Clean all temporary files to make sure no artifacts of the previous build remain
    1214                sh 'git clean -fdqx'
     15
     16                //Reset the git repo so no local changes persist
    1317                sh 'git reset --hard'
    1418
     
    2630        build_stage 'Test'
    2731
    28                 //Run the tests from the example directory
     32                //Run the tests from the tests directory
    2933                dir ('src/tests') {
    30                         sh './runTests.sh'
     34                        if (full_build) {
     35                                sh 'make all-tests'
     36                        }
     37                        else {
     38                                sh 'make'
     39                        }
    3140                }
    3241
     
    3544                //do a maintainer-clean to make sure we need to remake from scratch
    3645                sh 'make maintainer-clean > /dev/null'
     46}
     47
     48def make_doc() {
     49        def err = null
     50
     51        try {
     52                sh 'make clean > /dev/null'
     53                sh 'make > /dev/null 2>&1'
     54        }
     55
     56        catch (Exception caughtError) {
     57                //rethrow error later
     58                err = caughtError
     59
     60                sh 'cat *.log'
     61        }
     62
     63        finally {
     64                /* Must re-throw exception to propagate error */
     65                if (err) {
     66                        throw err
     67                }
     68        }
     69}
     70
     71def doc_build() {
     72        stage 'Documentation'
     73
     74                status_prefix = 'Documentation'
     75
     76                dir ('doc/user') {
     77                        make_doc()
     78                }
     79
     80                dir ('doc/refrat') {
     81                        make_doc()
     82                }
    3783}
    3884
     
    117163        try {
    118164                //Prevent the build from exceeding 30 minutes
    119                 timeout(30) {
     165                timeout(60) {
    120166
    121167                        //Wrap build to add timestamp to command line
     
    140186                                //Compile using gcc-4.9
    141187                                currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')
    142                                 cfa_build()
    143 
    144                                 //Compile using gcc-5
    145                                 currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
    146                                 cfa_build()
    147 
    148                                 //Compile using gcc-4.9
    149                                 currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
    150                                 cfa_build()
     188                                cfa_build(doPromoteBuild2DoLang)
     189
     190                                //Compile latex documentation
     191                                doc_build()
    151192
    152193                                if( doPromoteBuild2DoLang ) {
     194                                        //Compile using gcc-5
     195                                        currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
     196                                        cfa_build(true)
     197
     198                                        //Compile using gcc-4.9
     199                                        currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
     200                                        cfa_build(true)
     201
     202                                        //Push latest changes to do-lang repo
    153203                                        push_build()
    154204                                }
     
    185235//===========================================================================================================
    186236def notify_result(boolean promote, Exception err, String status, boolean log) {
     237        echo 'Build completed, sending result notification'
    187238        if(promote)     {
    188239                if( err ) {
     
    224275        def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    225276
    226         sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
    227         def gitLog = readFile('GIT_LOG')
    228 
    229         sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
    230         def gitDiff = readFile('GIT_DIFF')
     277        def gitLog = 'Error retrieving git logs'
     278        def gitDiff = 'Error retrieving git diff'
     279
     280        try {
     281
     282                sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     283                gitLog = readFile('GIT_LOG')
     284
     285                sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
     286                gitDiff = readFile('GIT_DIFF')
     287        }
     288        catch (Exception error) {}
    231289
    232290        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
Note: See TracChangeset for help on using the changeset viewer.