Search in sources :

Example 1 with UpstreamPromotionCondition

use of hudson.plugins.promoted_builds.conditions.UpstreamPromotionCondition 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()));
    }
}
Also used : DownstreamPassCondition(hudson.plugins.promoted_builds.conditions.DownstreamPassCondition) UpstreamPromotionCondition(hudson.plugins.promoted_builds.conditions.UpstreamPromotionCondition) ParameterizedSelfPromotionCondition(hudson.plugins.promoted_builds.conditions.ParameterizedSelfPromotionCondition) SelfPromotionCondition(hudson.plugins.promoted_builds.conditions.SelfPromotionCondition) ParameterizedSelfPromotionCondition(hudson.plugins.promoted_builds.conditions.ParameterizedSelfPromotionCondition)

Aggregations

DownstreamPassCondition (hudson.plugins.promoted_builds.conditions.DownstreamPassCondition)1 ParameterizedSelfPromotionCondition (hudson.plugins.promoted_builds.conditions.ParameterizedSelfPromotionCondition)1 SelfPromotionCondition (hudson.plugins.promoted_builds.conditions.SelfPromotionCondition)1 UpstreamPromotionCondition (hudson.plugins.promoted_builds.conditions.UpstreamPromotionCondition)1