All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.bamboo.specs.builders.trigger.AfterSuccessfulBuildPlanTrigger Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.builders.trigger;

import com.atlassian.bamboo.specs.api.builders.trigger.Trigger;
import com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException;
import com.atlassian.bamboo.specs.model.trigger.AfterSuccessfulBuildPlanTriggerProperties;
import org.jetbrains.annotations.Nullable;

/**
 * Trigger which schedule a deployment when plan build complete.
 */
public class AfterSuccessfulBuildPlanTrigger extends Trigger {
    private String releaseBranch;

    public AfterSuccessfulBuildPlanTrigger() throws PropertiesValidationException {
    }

    /**
     * Configure trigger to start deployment when plan master branch is updated.
     */
    public AfterSuccessfulBuildPlanTrigger triggerByMasterBranch() {
        releaseBranch = null;
        return this;
    }

    /**
     * Configure trigger to start deployment when plan branch is updated.
     *
     * @param planBranchName name of plan branch. If value is null it's the same as {@link #triggerByMasterBranch()}
     */
    public AfterSuccessfulBuildPlanTrigger triggerByBranch(@Nullable String planBranchName) {
        this.releaseBranch = planBranchName;
        return this;
    }

    @Override
    protected AfterSuccessfulBuildPlanTriggerProperties build() {
        return new AfterSuccessfulBuildPlanTriggerProperties(name, description, triggerEnabled, releaseBranch);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy