Created
May 13, 2019 02:29
-
-
Save rufoa/2807ad19328f70dc81fec25c317661b8 to your computer and use it in GitHub Desktop.
Jenkins [skip ci] implementation for multi-branch declarative 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
// change 'agent' lines as appropriate | |
pipeline { | |
agent none | |
stages { | |
stage('Run CI?') { | |
agent any | |
steps { | |
script { | |
if (sh(script: "git log -1 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]'", returnStatus: true) == 0) { | |
currentBuild.result = 'NOT_BUILT' | |
error 'Aborting because commit message contains [skip ci]' | |
} | |
} | |
} | |
} | |
stage('next stage') { | |
agent { dockerfile true } | |
steps { | |
echo 'next stage here...' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for that @moertel!