Changes in / [0797198:8e655f7c]


Ignore:
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r0797198 r8e655f7c  
    22
    33import groovy.transform.Field
     4
     5// For skipping stages
     6import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
    47
    58//===========================================================================================================
     
    1215        SrcDir    = pwd tmp: false
    1316        Settings  = null
    14         Tools     = null
     17        StageName = ''
    1518
    1619        // Local variables
     
    6366
    6467                //Store the result of the build log
    65                 currentBuild.result = "${tools.StageName} FAILURE".trim()
     68                currentBuild.result = "${StageName} FAILURE".trim()
    6669        }
    6770
     
    8285//===========================================================================================================
    8386def clean() {
    84         Tools.BuildStage('Cleanup', true) {
     87        build_stage('Cleanup', true) {
    8588                // clean the build by wipping the build directory
    8689                dir(BuildDir) {
     
    9295//Compilation script is done here but environnement set-up and error handling is done in main loop
    9396def checkout() {
    94         Tools.BuildStage('Checkout', true) {
     97        build_stage('Checkout', true) {
    9598                //checkout the source code and clean the repo
    9699                final scmVars = checkout scm
     
    105108        debug = true
    106109        release = Settings.RunAllTests || Settings.RunBenchmark
    107         Tools.BuildStage('Build : configure', true) {
     110        build_stage('Build : configure', true) {
    108111                // Configure must be run inside the tree
    109112                dir (SrcDir) {
     
    133136        }
    134137
    135         Tools.BuildStage('Build : cfa-cpp', true) {
     138        build_stage('Build : cfa-cpp', true) {
    136139                // Build outside of the src tree to ease cleaning
    137140                dir (BuildDir) {
     
    144147        }
    145148
    146         Tools.BuildStage('Build : libcfa(debug)', debug) {
     149        build_stage('Build : libcfa(debug)', debug) {
    147150                // Build outside of the src tree to ease cleaning
    148151                dir (BuildDir) {
     
    151154        }
    152155
    153         Tools.BuildStage('Build : libcfa(nodebug)', release) {
     156        build_stage('Build : libcfa(nodebug)', release) {
    154157                // Build outside of the src tree to ease cleaning
    155158                dir (BuildDir) {
     
    158161        }
    159162
    160         Tools.BuildStage('Build : install', true) {
     163        build_stage('Build : install', true) {
    161164                // Build outside of the src tree to ease cleaning
    162165                dir (BuildDir) {
     
    168171def test() {
    169172        try {
    170                 Tools.BuildStage('Test: short', !Settings.RunAllTests) {
     173                build_stage('Test: short', !Settings.RunAllTests) {
    171174                        dir (BuildDir) {
    172175                                //Run the tests from the tests directory
     
    175178                }
    176179
    177                 Tools.BuildStage('Test: full', Settings.RunAllTests) {
     180                build_stage('Test: full', Settings.RunAllTests) {
    178181                        dir (BuildDir) {
    179182                                        //Run the tests from the tests directory
     
    193196
    194197def benchmark() {
    195         Tools.BuildStage('Benchmark', Settings.RunBenchmark) {
     198        build_stage('Benchmark', Settings.RunBenchmark) {
    196199                dir (BuildDir) {
    197200                        //Append bench results
     
    202205
    203206def build_doc() {
    204         Tools.BuildStage('Documentation', Settings.BuildDocumentation) {
     207        build_stage('Documentation', Settings.BuildDocumentation) {
    205208                dir ('doc/user') {
    206209                        make_doc()
     
    214217
    215218def publish() {
    216         Tools.BuildStage('Publish', true) {
     219        build_stage('Publish', true) {
    217220
    218221                if( Settings.Publish && !Settings.RunBenchmark ) { echo 'No results to publish!!!' }
     
    503506                ]])
    504507
    505         // It's unfortunate but it looks like we need to checkout the entire repo just to get
    506         // - the pretty git printer
    507         // - Jenkins.tools
     508        // It's unfortunate but it looks like we need to checkout the entire repo just to get the pretty git printer
    508509        checkout scm
    509 
    510         Tools = load "Jenkins/tools.groovy"
    511510
    512511        final settings = new BuildSettings(params, env.BRANCH_NAME)
     
    516515
    517516        return settings
     517}
     518
     519def build_stage(String name, boolean run, Closure block ) {
     520        StageName = name
     521        echo " -------- ${StageName} -------- "
     522        if(run) {
     523                stage(name, block)
     524        } else {
     525                stage(name) { Utils.markStageSkippedForConditional(STAGE_NAME) }
     526        }
    518527}
    519528
Note: See TracChangeset for help on using the changeset viewer.