Created
August 29, 2017 20:26
-
-
Save ericlong/25fd60f197f6c4c7b8f265af7a351e75 to your computer and use it in GitHub Desktop.
Let's Build a Jenkins Pipeline
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 | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Hello from Build' | |
} | |
} | |
stage('Test') { | |
steps { | |
echo 'Testing Testing 123' | |
} | |
} | |
stage('Deploy') { | |
steps { | |
echo 'Deploy some things' | |
} | |
} | |
} | |
} |
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 { | |
label 'docker' | |
} | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Hello from Build' | |
} | |
} | |
stage('Test') { | |
steps { | |
echo 'Testing Testing 123' | |
} | |
} | |
stage('Deploy') { | |
steps { | |
echo 'Deploy some things' | |
} | |
} | |
} | |
} |
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 { | |
label 'docker' | |
} | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Hello from Build' | |
writeFile(file: 'config', text: 'version=1', encoding: 'UTF-8') | |
stash(name: 'pom-config', includes: 'config') | |
} | |
} | |
stage('Test') { | |
environment { | |
configValue = readFile(encoding: 'UTF-8', file: 'config') | |
} | |
steps { | |
echo 'Testing Testing 123' | |
unstash 'pom-config' | |
sh 'echo "$configValue"' | |
} | |
} | |
stage('Deploy') { | |
steps { | |
echo 'Deploy some things' | |
} | |
} | |
} | |
} |
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 { | |
label 'docker' | |
} | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Hello from Build' | |
writeFile(file: 'config', text: 'version=1', encoding: 'UTF-8') | |
stash(name: 'pom-config', includes: 'config') | |
} | |
} | |
stage('Test') { | |
environment { | |
configValue = readFile(encoding: 'UTF-8', file: 'config') | |
} | |
steps { | |
echo 'Testing Testing 123' | |
unstash 'pom-config' | |
sh 'echo "$configValue"' | |
} | |
} | |
stage('Deploy') { | |
steps { | |
echo 'Deploy some things' | |
input 'Do you want to deploy?' | |
echo 'deployed' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment