Forked from jvanderhoof/jenkins-example-jenkinsfile
Created
December 26, 2017 08:20
-
-
Save cyeong/1891bbecc45d731c935c97b980ae089f 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
#!/usr/bin/env groovy | |
pipeline { | |
agent { label 'executor-v2' } | |
options { | |
timestamps() | |
buildDiscarder(logRotator(numToKeepStr: '30')) | |
} | |
stages { | |
stage('Test') { | |
steps { | |
milestone(1) | |
sh './test.sh' | |
junit 'spec/reports/*.xml' | |
junit 'features/reports/*.xml' | |
} | |
} | |
// Only publish to RubyGems if branch is 'master' | |
stage('Publish to RubyGems?') { | |
agent { label 'releaser' } | |
when { | |
branch 'master' | |
} | |
steps { | |
sh './publish.sh' | |
// Clean up | |
sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd' | |
deleteDir() | |
} | |
} | |
} | |
post { | |
always { | |
cleanupAndNotify(currentBuild.currentResult) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment