Changes in / [0797198:8e655f7c]
- Files:
-
- 1 deleted
- 1 edited
-
Jenkins/tools.groovy (deleted)
-
Jenkinsfile (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r0797198 r8e655f7c 2 2 3 3 import groovy.transform.Field 4 5 // For skipping stages 6 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils 4 7 5 8 //=========================================================================================================== … … 12 15 SrcDir = pwd tmp: false 13 16 Settings = null 14 Tools = null17 StageName = '' 15 18 16 19 // Local variables … … 63 66 64 67 //Store the result of the build log 65 currentBuild.result = "${ tools.StageName} FAILURE".trim()68 currentBuild.result = "${StageName} FAILURE".trim() 66 69 } 67 70 … … 82 85 //=========================================================================================================== 83 86 def clean() { 84 Tools.BuildStage('Cleanup', true) {87 build_stage('Cleanup', true) { 85 88 // clean the build by wipping the build directory 86 89 dir(BuildDir) { … … 92 95 //Compilation script is done here but environnement set-up and error handling is done in main loop 93 96 def checkout() { 94 Tools.BuildStage('Checkout', true) {97 build_stage('Checkout', true) { 95 98 //checkout the source code and clean the repo 96 99 final scmVars = checkout scm … … 105 108 debug = true 106 109 release = Settings.RunAllTests || Settings.RunBenchmark 107 Tools.BuildStage('Build : configure', true) {110 build_stage('Build : configure', true) { 108 111 // Configure must be run inside the tree 109 112 dir (SrcDir) { … … 133 136 } 134 137 135 Tools.BuildStage('Build : cfa-cpp', true) {138 build_stage('Build : cfa-cpp', true) { 136 139 // Build outside of the src tree to ease cleaning 137 140 dir (BuildDir) { … … 144 147 } 145 148 146 Tools.BuildStage('Build : libcfa(debug)', debug) {149 build_stage('Build : libcfa(debug)', debug) { 147 150 // Build outside of the src tree to ease cleaning 148 151 dir (BuildDir) { … … 151 154 } 152 155 153 Tools.BuildStage('Build : libcfa(nodebug)', release) {156 build_stage('Build : libcfa(nodebug)', release) { 154 157 // Build outside of the src tree to ease cleaning 155 158 dir (BuildDir) { … … 158 161 } 159 162 160 Tools.BuildStage('Build : install', true) {163 build_stage('Build : install', true) { 161 164 // Build outside of the src tree to ease cleaning 162 165 dir (BuildDir) { … … 168 171 def test() { 169 172 try { 170 Tools.BuildStage('Test: short', !Settings.RunAllTests) {173 build_stage('Test: short', !Settings.RunAllTests) { 171 174 dir (BuildDir) { 172 175 //Run the tests from the tests directory … … 175 178 } 176 179 177 Tools.BuildStage('Test: full', Settings.RunAllTests) {180 build_stage('Test: full', Settings.RunAllTests) { 178 181 dir (BuildDir) { 179 182 //Run the tests from the tests directory … … 193 196 194 197 def benchmark() { 195 Tools.BuildStage('Benchmark', Settings.RunBenchmark) {198 build_stage('Benchmark', Settings.RunBenchmark) { 196 199 dir (BuildDir) { 197 200 //Append bench results … … 202 205 203 206 def build_doc() { 204 Tools.BuildStage('Documentation', Settings.BuildDocumentation) {207 build_stage('Documentation', Settings.BuildDocumentation) { 205 208 dir ('doc/user') { 206 209 make_doc() … … 214 217 215 218 def publish() { 216 Tools.BuildStage('Publish', true) {219 build_stage('Publish', true) { 217 220 218 221 if( Settings.Publish && !Settings.RunBenchmark ) { echo 'No results to publish!!!' } … … 503 506 ]]) 504 507 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 508 509 checkout scm 509 510 Tools = load "Jenkins/tools.groovy"511 510 512 511 final settings = new BuildSettings(params, env.BRANCH_NAME) … … 516 515 517 516 return settings 517 } 518 519 def 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 } 518 527 } 519 528
Note:
See TracChangeset
for help on using the changeset viewer.