Created
July 14, 2020 17:22
-
-
Save paul-lupu/a8be789e6d7d65996207b8e00fa7140c 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
pipeline { | |
agent any | |
options { | |
preserveStashes(buildCount: 10) | |
} | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Building..' | |
sh """ | |
mkdir $BUILD_NUMBER | |
touch $BUILD_NUMBER/version.txt | |
echo $BUILD_NUMBER > $BUILD_NUMBER/version.txt | |
""" | |
stash name: "${currentBuild.number}", includes: "$BUILD_NUMBER/*" | |
} | |
} | |
stage('Test') { | |
steps { | |
unstash "${currentBuild.number}" | |
sh "cat $BUILD_NUMBER/version.txt" | |
} | |
} | |
stage('Deploy') { | |
steps { | |
echo 'Deploying....' | |
} | |
} | |
} | |
} |
kwerle
commented
Jul 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment