Skip to content

Instantly share code, notes, and snippets.

@consolewitch
Created January 2, 2020 07:05
Show Gist options
  • Save consolewitch/2f1a316e7117106fc1b3e54aa37696cf to your computer and use it in GitHub Desktop.
Save consolewitch/2f1a316e7117106fc1b3e54aa37696cf to your computer and use it in GitHub Desktop.
a working jenkins pipeline with some helpful examples
properties([
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '60',
numToKeepStr: ''
)
),
pipelineTriggers([githubPush()])
])
node ('stack') {
stage('build') {
parallel (
"create-monocluster": {
node('stack'){
def testVar
testVar = "alonsis"
echo "${env.BUILD_ID}"
echo "${testVar}"
String sloopVar=env.BUILD_ID
echo "${sloopVar}"
withEnv(["TESTVAR=${testVar}"]){
sh '''
#echo "${env.BUILD_ID}"
echo create monocluster stage
echo $TESTVAR
printenv
'''
}
}
},
"haskell-build": {
node('stack'){
sh '''
echo haskell build stage
'''
}
}
)
}
stage('deploy-to-monocluster') {
sh '''
echo deploy stage
'''
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment