use of hudson.plugins.promoted_builds.conditions.ParameterizedSelfPromotionCondition in project promoted-builds-plugin by jenkinsci.
the class PromotionContext method conditions.
public void conditions(Closure<?> conditionClosure) {
// delegate to ConditionsContext
ConditionsContext conditionContext = new ConditionsContext(dslEnvironment);
executeInContext(conditionClosure, conditionContext);
if (conditionContext.isSelfPromotion()) {
conditions.add(new SelfPromotionCondition(conditionContext.isEvenIfUnstable()));
}
if (conditionContext.isParameterizedSelfPromotion()) {
conditions.add(new ParameterizedSelfPromotionCondition(conditionContext.isEvenIfUnstableParameterized(), conditionContext.getParameterName(), conditionContext.getParameterValue()));
}
if (conditionContext.isManual()) {
JobDslManualCondition condition = new JobDslManualCondition();
condition.setUsers(conditionContext.getUsers());
if (conditionContext.getParams() != null) {
condition.setParameterDefinitionNodes(conditionContext.getParams().values());
}
conditions.add(condition);
}
if (conditionContext.isReleaseBuild()) {
conditions.add(new ReleasePromotionCondition());
}
if (conditionContext.isDownstreamPass()) {
conditions.add(new DownstreamPassCondition(conditionContext.getJobs(), conditionContext.isEvenIfUnstableDownstream()));
}
if (conditionContext.isUpstreamPromotion()) {
conditions.add(new UpstreamPromotionCondition(conditionContext.getPromotionNames()));
}
}
Aggregations