Skip to content

Commit

Permalink
Prevent non release builds from master.
Browse files Browse the repository at this point in the history
  • Loading branch information
whyjustin committed Sep 12, 2018
1 parent d9a065c commit cc181b4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Jenkinsfile.sonatype
Expand Up @@ -49,6 +49,15 @@ Closure iqPolicyEvaluation = {
}

if (!params.isRelease) {
/**
* Currently master branch will attempt a deploy which requires logic invoked when isRelease is true. If
* mavenSnapshotPipeline is used on master an unauthorized deploy will be attempted against the jenkinsci repository.
**/
if (scm.branches[0].name == '*/master') {
echo 'Master builds should only be used for release.'
return
}

mavenSnapshotPipeline(
notificationSender: postHandler,
iqPolicyEvaluation: iqPolicyEvaluation
Expand Down

0 comments on commit cc181b4

Please sign in to comment.