Changeset 620dd2b for Jenkinsfile


Ignore:
Timestamp:
May 8, 2017, 11:43:27 AM (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:
f408e1a
Parents:
7c0ef42
Message:

Tentative fix for deprecated stages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r7c0ef42 r620dd2b  
    9797        //parse git logs to find what changed
    9898        gitRefName = env.BRANCH_NAME
    99         // dir("../${gitRefName}@script") {
    10099        sh "git reflog > ${out_dir}/GIT_COMMIT"
    101         // }
    102100        git_reflog = readFile("${out_dir}/GIT_COMMIT")
    103101        gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
     
    172170}
    173171
    174 def build_stage(String name) {
     172def build_stage(String name, Closure block ) {
    175173        stage_name = name
    176         stage name
     174        stage(name, block)
    177175}
    178176
     
    247245//Compilation script is done here but environnement set-up and error handling is done in main loop
    248246def checkout() {
    249         build_stage'Checkout'
     247        build_stage('Checkout') {
    250248                //checkout the source code and clean the repo
    251249                checkout scm
     
    256254                //Reset the git repo so no local changes persist
    257255                sh 'git reset --hard'
     256        }
    258257}
    259258
    260259def build() {
    261         build_stage'Build'
     260        build_stage('Build') {
    262261       
    263262                def install_dir = pwd tmp: true
     
    271270                //Compile the project
    272271                sh 'make -j 8 --no-print-directory V=0 install'
     272        }
    273273}
    274274
    275275def test() {
    276         build_stage'Test'
     276        build_stage('Test') {
    277277
    278278                //Run the tests from the tests directory
     
    284284                        sh 'make -C src/tests'
    285285                }
     286        }
    286287}
    287288
    288289def benchmark() {
    289         build_stage'Benchmark'
     290        build_stage('Benchmark') {
    290291
    291292                if( !do_benchmark ) return
     
    296297                //Append bench results
    297298                sh 'make -C src/benchmark --no-print-directory csv-data >> bench.csv'
     299        }
    298300}
    299301
    300302def clean() {
    301         build_stage'Cleanup'
     303        build_stage('Cleanup') {
    302304
    303305                //do a maintainer-clean to make sure we need to remake from scratch
    304306                sh 'make maintainer-clean > /dev/null'
     307        }
    305308}
    306309
    307310def build_doc() {
    308         build_stage'Documentation'
     311        build_stage('Documentation') {
    309312
    310313                if( !do_doc ) return
     
    317320                        make_doc()
    318321                }
     322        }
    319323}
    320324
    321325def publish() {
    322         build_stage'Publish'
     326        build_stage('Publish') {
    323327
    324328                if( !do_publish ) return
     
    326330                //Then publish the results
    327331                sh 'curl --silent --data @bench.csv http://plg2:8082/jenkins/publish > /dev/null || true'
     332        }
    328333}
    329334
Note: See TracChangeset for help on using the changeset viewer.