-
-
Save bhamilton/e019094502fc48f523d02eadc0f564c7 to your computer and use it in GitHub Desktop.
Let's Build a Jenkins Pipeline
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
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 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
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 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
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 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
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