Skip to content

Commit

Permalink
ci: go master version stage is not triggered (#1214)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Feb 16, 2022
1 parent 17f24e8 commit 675e839
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions Jenkinsfile
Expand Up @@ -283,40 +283,42 @@ pipeline {

def generateStep(version){
return {
node('linux && immutable'){
try {
echo "${version}"
withEnv(["GO_VERSION=${version}"]) {
// Another retry in case there are any environmental issues
// See https://issuetracker.google.com/issues/146072599 for more context
retry(3) {
deleteDir()
unstash 'source'
}
retry(3) {
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/build.sh', label: 'Build'
}
}
runStep(version)
}
}

def runStep(version) {
node('linux && immutable'){
try {
echo "${version}"
withEnv(["GO_VERSION=${version}"]) {
// Another retry in case there are any environmental issues
// See https://issuetracker.google.com/issues/146072599 for more context
retry(3) {
deleteDir()
unstash 'source'
}
retry(3) {
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/test.sh', label: 'Test'
sh script: './scripts/jenkins/build.sh', label: 'Build'
}
}
} catch(e){
error(e.toString())
} finally {
junit(allowEmptyResults: true,
keepLongStdio: true,
testResults: "${BASE_DIR}/build/junit-*.xml")
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/test.sh', label: 'Test'
}
}
} finally {
junit(allowEmptyResults: true,
keepLongStdio: true,
testResults: "${BASE_DIR}/build/junit-*.xml")
}
}
}

def generateStepAndCatchError(version){
return {
catchError(buildResult: 'SUCCESS', message: 'Cutting Edge Tests', stageResult: 'UNSTABLE') {
generateStep(version)
runStep(version)
}
}
}
Expand Down

0 comments on commit 675e839

Please sign in to comment.