Created
January 29, 2019 15:24
-
-
Save solvingj/98af537674d918fb70b1f50b356fe72a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AT_REVISION = "" | |
pipeline { | |
agent { | |
label 'agent2' | |
} | |
stages { | |
stage('build_image_locally') { | |
steps { | |
script { | |
AT_REVISION="1234" | |
} | |
bat 'echo AT_REVISION = %AT_REVISION%' | |
bat 'echo AT_REVISION = ${AT_REVISION}' | |
} | |
} | |
} | |
} | |
Somehow the block below from an example seems to work. GIT_BRANCH is available after scope | |
stage ('Build') { | |
when { | |
expression { | |
GIT_BRANCH = 'origin/' + sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim() | |
return GIT_BRANCH == 'origin/master' || params.FORCE_FULL_BUILD | |
} | |
} | |
steps { | |
parallel ( | |
linux: { | |
build job: 'full-build-linux', parameters: [string(name: 'GIT_BRANCH_NAME', value: GIT_BRANCH)] | |
}, | |
failFast: false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment