Changeset 6250a312 for Jenkinsfile


Ignore:
Timestamp:
May 10, 2017, 5:00:47 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8514fe19, dbfb35d
Parents:
0f9bef3 (diff), 29cf9c8 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r0f9bef3 r6250a312  
    2828                wrap([$class: 'TimestamperBuildWrapper']) {
    2929
    30                         //Prevent the build from exceeding 60 minutes
    31                         timeout(60) {
    32 
    33                                 notify_server()
    34 
    35                                 prepare_build()
    36 
    37                                 checkout()
    38 
    39                                 build()
    40 
    41                                 test()
    42 
    43                                 benchmark()
    44 
    45                                 clean()
    46 
    47                                 build_doc()
    48 
    49                                 publish()
    50 
    51                                 notify_server()
    52                         }
     30                        notify_server()
     31
     32                        prepare_build()
     33
     34                        checkout()
     35
     36                        build()
     37
     38                        test()
     39
     40                        benchmark()
     41
     42                        clean()
     43
     44                        build_doc()
     45
     46                        publish()
     47
     48                        notify_server()
    5349                }
    5450        }
     
    8985def collect_git_info() {
    9086
     87        checkout scm
     88
    9189        //create the temporary output directory in case it doesn't already exist
    9290        def out_dir = pwd tmp: true
     
    9593        //parse git logs to find what changed
    9694        gitRefName = env.BRANCH_NAME
    97         dir("../${gitRefName}@script") {
    98                 sh "git reflog > ${out_dir}/GIT_COMMIT"
    99         }
     95        sh "git reflog > ${out_dir}/GIT_COMMIT"
    10096        git_reflog = readFile("${out_dir}/GIT_COMMIT")
    10197        gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
     
    170166}
    171167
    172 def build_stage(String name) {
     168def build_stage(String name, Closure block ) {
    173169        stage_name = name
    174         stage name
     170        stage(name, block)
    175171}
    176172
     
    245241//Compilation script is done here but environnement set-up and error handling is done in main loop
    246242def checkout() {
    247         build_stage'Checkout'
     243        build_stage('Checkout') {
    248244                //checkout the source code and clean the repo
    249245                checkout scm
     
    254250                //Reset the git repo so no local changes persist
    255251                sh 'git reset --hard'
     252        }
    256253}
    257254
    258255def build() {
    259         build_stage'Build'
     256        build_stage('Build') {
    260257       
    261258                def install_dir = pwd tmp: true
     
    269266                //Compile the project
    270267                sh 'make -j 8 --no-print-directory V=0 install'
     268        }
    271269}
    272270
    273271def test() {
    274         build_stage'Test'
     272        build_stage('Test') {
    275273
    276274                //Run the tests from the tests directory
    277275                if ( do_alltests ) {
    278                         sh 'make -C src/tests all-tests debug=yes'
    279                         sh 'make -C src/tests all-tests debug=no'
     276                        sh 'make -C src/tests all-tests debug=yes --no-print-directory'
     277                        sh 'make -C src/tests all-tests debug=no --no-print-directory'
    280278                }
    281279                else {
    282                         sh 'make -C src/tests'
    283                 }
     280                        sh 'make -C src/tests --no-print-directory'
     281                }
     282        }
    284283}
    285284
    286285def benchmark() {
    287         build_stage'Benchmark'
     286        build_stage('Benchmark') {
    288287
    289288                if( !do_benchmark ) return
     
    294293                //Append bench results
    295294                sh 'make -C src/benchmark --no-print-directory csv-data >> bench.csv'
     295        }
    296296}
    297297
    298298def clean() {
    299         build_stage'Cleanup'
     299        build_stage('Cleanup') {
    300300
    301301                //do a maintainer-clean to make sure we need to remake from scratch
    302302                sh 'make maintainer-clean > /dev/null'
     303        }
    303304}
    304305
    305306def build_doc() {
    306         build_stage'Documentation'
     307        build_stage('Documentation') {
    307308
    308309                if( !do_doc ) return
     
    315316                        make_doc()
    316317                }
     318        }
    317319}
    318320
    319321def publish() {
    320         build_stage'Publish'
     322        build_stage('Publish') {
    321323
    322324                if( !do_publish ) return
     
    324326                //Then publish the results
    325327                sh 'curl --silent --data @bench.csv http://plg2:8082/jenkins/publish > /dev/null || true'
     328        }
    326329}
    327330
     
    371374"""
    372375
    373         def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com"
     376        def email_to = "pabuhr@uwaterloo.ca, rschlunt@uwaterloo.ca, a3moss@uwaterloo.ca, tdelisle@uwaterloo.ca, brice.dobry@huawei.com, ajbeach@edu.uwaterloo.ca"
    374377
    375378        //send email notification
Note: See TracChangeset for help on using the changeset viewer.