Created
January 2, 2020 07:05
-
-
Save consolewitch/2f1a316e7117106fc1b3e54aa37696cf to your computer and use it in GitHub Desktop.
a working jenkins pipeline with some helpful examples
This file contains hidden or 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
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