Changeset 3e3f236 for Jenkins/Distribute
- Timestamp:
- Dec 10, 2020, 4:00:29 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 97aca3df, b3a0df6
- Parents:
- 6a45bd78 (diff), 297cf18 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/Distribute
r6a45bd78 r3e3f236 15 15 SrcDir = pwd tmp: false 16 16 Settings = null 17 Version = '' 17 18 18 19 // Local variables … … 22 23 currentBuild.result = "SUCCESS" 23 24 24 try { 25 //Wrap build to add timestamp to command line 26 wrap([$class: 'TimestamperBuildWrapper']) { 25 //Wrap build to add timestamp to command line 26 wrap([$class: 'TimestamperBuildWrapper']) { 27 27 28 final commit = prepare_build() 28 final commit, build 29 (commit, build) = prepare_build() 29 30 30 node('x64') { 31 BuildDir = pwd tmp: true 32 SrcDir = pwd tmp: false 33 34 Tools.Clean() 35 36 Tools.Checkout( commit ) 37 } 38 39 // Update the build directories when exiting the node 31 node('x64') { 40 32 BuildDir = pwd tmp: true 41 33 SrcDir = pwd tmp: false 34 35 Tools.Clean() 36 37 Tools.Checkout( commit ) 38 39 Version = GetVersion( build ) 40 41 Configure() 42 43 Package() 44 45 Test() 46 47 Archive() 42 48 } 49 50 // Update the build directories when exiting the node 51 BuildDir = pwd tmp: true 52 SrcDir = pwd tmp: false 43 53 } 44 54 45 //If an exception is caught we need to change the status and remember to46 //attach the build log to the email47 // catch (Exception caughtError) {48 // //rethrow error later49 // err = caughtError50 51 // echo err.toString()52 53 // //An error has occured, the build log is relevent54 // log_needed = true55 56 // //Store the result of the build log57 // currentBuild.result = "${StageName} FAILURE".trim()58 // }59 60 finally {61 // //Send email with final results if this is not a full build62 // email(log_needed)63 64 // echo 'Distribution Completed'65 66 // /* Must re-throw exception to propagate error */67 // if (err) {68 // throw err69 // }70 }71 55 } 72 56 … … 74 58 // Main compilation routines 75 59 //=========================================================================================================== 60 def GetVersion(build) { 61 final pver = sh( 62 returnStdout: true, 63 script: "sed 's/AC_INIT(\\[cfa-cc\\],\\[\\(.*\\)\\],\\[cforall@plg.uwaterloo.ca\\])/\\1/;t;d' ${SrcDir}/configure.ac" 64 ).trim() 76 65 66 final version = "${pver}.${build}" 77 67 78 //Compilation script is done here but environnement set-up and error handling is done in main loop 79 // def checkout() { 80 // build_stage('Checkout', true) { 81 // //checkout the source code and clean the repo 82 // final scmVars = checkout scm 83 // Settings.GitNewRef = scmVars.GIT_COMMIT 84 // Settings.GitOldRef = scmVars.GIT_PREVIOUS_COMMIT 68 echo "Package Version: ${pver}" 69 echo "Build Version: ${build}" 70 echo "Long Version: ${version}" 85 71 86 // echo GitLogMessage() 87 // } 88 // } 72 return version 73 } 74 75 def Configure() { 76 Tools.BuildStage('Configure', true) { 77 // Configure must be run inside the tree 78 dir (SrcDir) { 79 // Generate the necessary build files 80 sh './autogen.sh' 81 } 82 83 // Build outside of the src tree to ease cleaning 84 dir (BuildDir) { 85 // Configure the compilation (Output is not relevant) 86 // Use the current directory as the installation target so nothing escapes the sandbox 87 // Also specify the compiler by hand 88 sh "${SrcDir}/configure CXX=g++-9 CC=gcc-9 AR=gcc-ar RANLIB=gcc-ranlib --quiet" 89 90 // Configure libcfa 91 sh 'make -j 8 --no-print-directory configure-libcfa' 92 } 93 } 94 } 95 96 def Package() { 97 Tools.BuildStage('Package', true) { 98 dir (BuildDir) { 99 sh "make VERSION=${Version} dist" 100 } 101 } 102 } 103 104 def Test() { 105 Tools.BuildStage('Test', true) { 106 dir (BuildDir) { 107 sh "make VERSION=${Version} distcheck -j 8" 108 } 109 } 110 } 111 112 def Archive() { 113 Tools.BuildStage('Archive', true) { 114 dir (BuildDir) { 115 archiveArtifacts artifacts: "cfa-cc-*.tar.gz", fingerprint: true 116 } 117 } 118 } 119 89 120 90 121 //=========================================================================================================== … … 107 138 defaultValue: '', \ 108 139 ], \ 140 [$class: 'StringParameterDefinition', \ 141 description: 'Build Number to put into the version', \ 142 name: 'Build', \ 143 defaultValue: '0', \ 144 ], \ 109 145 ], 110 146 ]]) … … 121 157 echo "Distributing git commit ${ref}" 122 158 123 return params.GitRef159 return [params.GitRef, params.Build] 124 160 } 125 161
Note:
See TracChangeset
for help on using the changeset viewer.