Skip to content

Instantly share code, notes, and snippets.

@topera
Created July 7, 2018 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topera/b1b035e99adb34ff64d7b90414d8097b to your computer and use it in GitHub Desktop.
Save topera/b1b035e99adb34ff64d7b90414d8097b to your computer and use it in GitHub Desktop.
Example of basic Jenkinspipeline
pipeline {
agent {
any {}
}
stages {
stage('setup') {
steps {
sh './gradlew tasks'
}
}
stage('test') {
steps {
sh './gradlew runClean createVersion test'
}
}
stage('createImage') {
when {
branch 'master'
}
steps {
sh './gradlew runCreateImage'
}
}
stage('publishImage') {
when {
branch 'master'
}
steps {
sh './gradlew dockerLogin publishImage'
}
}
stage('deploy') {
when {
branch 'master'
}
steps {
sh './gradlew fobitDeploy'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment