Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed JENKINS-31974
  • Loading branch information
MadsNielsen committed Dec 9, 2015
1 parent 0d0b0be commit fa6e837
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/net/praqma/hudson/scm/CCUCMScm.java
Expand Up @@ -212,6 +212,14 @@ private String _getComponent() {
return component;
}

private boolean shouldRetrigger(AbstractBuild<?, ?> build, Baseline updated) {
//If the ANY promotion level is selected
if (mode.getPromotionLevel() == null) {
return true;
}
return updated != null && mode.getPromotionLevel().equals(updated.getPromotionLevel()) && !(mode instanceof PollRebaseMode);
}

@Override
public boolean checkout(AbstractBuild<?, ?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException {
/* Prepare job variables */
Expand Down Expand Up @@ -292,7 +300,7 @@ public boolean checkout(AbstractBuild<?, ?> build, Launcher launcher, FilePath w
If the promotion level is not set, ANY, use the last found Baseline. Alternatively, if the baseline that was last built has not been altered (Rejected/Promoted)
the we assume we can safely do the same again.
*/
if (mode.getPromotionLevel() == null || (updated != null && mode.getPromotionLevel().equals(updated.getPromotionLevel()))) {
if (shouldRetrigger(build, updated)) {
logger.fine("Configured to use the latest always.");
if (last != null) {
action.setBaseline(last.getBaseline());
Expand Down

0 comments on commit fa6e837

Please sign in to comment.