Class Job.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<Job>
    Enclosing interface:
    Job

    @Stability(Experimental)
    public static final class Job.Builder
    extends Object
    implements software.amazon.jsii.Builder<Job>
    A builder for Job
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • allowFailure

        @Stability(Experimental)
        public Job.Builder allowFailure​(Boolean allowFailure)
        Sets the value of Job.getAllowFailure()
        Parameters:
        allowFailure - Whether to allow the pipeline to continue running on job failure (Default: false).
        Returns:
        this
      • allowFailure

        @Stability(Experimental)
        public Job.Builder allowFailure​(AllowFailure allowFailure)
        Sets the value of Job.getAllowFailure()
        Parameters:
        allowFailure - Whether to allow the pipeline to continue running on job failure (Default: false).
        Returns:
        this
      • cache

        @Stability(Experimental)
        public Job.Builder cache​(List<? extends Cache> cache)
        Sets the value of Job.getCache()
        Parameters:
        cache - the value to be set.
        Returns:
        this
      • coverage

        @Stability(Experimental)
        public Job.Builder coverage​(String coverage)
        Sets the value of Job.getCoverage()
        Parameters:
        coverage - Must be a regular expression, optionally but recommended to be quoted, and must be surrounded with '/'. Example: '/Code coverage: \d+.\d+/'
        Returns:
        this
      • dependencies

        @Stability(Experimental)
        public Job.Builder dependencies​(List<String> dependencies)
        Sets the value of Job.getDependencies()
        Parameters:
        dependencies - Specify a list of job names from earlier stages from which artifacts should be loaded. By default, all previous artifacts are passed. Use an empty array to skip downloading artifacts.
        Returns:
        this
      • environment

        @Stability(Experimental)
        public Job.Builder environment​(String environment)
        Sets the value of Job.getEnvironment()
        Parameters:
        environment - Used to associate environment metadata with a deploy. Environment can have a name and URL attached to it, and will be displayed under /environments under the project.
        Returns:
        this
      • environment

        @Stability(Experimental)
        public Job.Builder environment​(Environment environment)
        Sets the value of Job.getEnvironment()
        Parameters:
        environment - Used to associate environment metadata with a deploy. Environment can have a name and URL attached to it, and will be displayed under /environments under the project.
        Returns:
        this
      • except

        @Stability(Experimental)
        public Job.Builder except​(List<String> except)
        Sets the value of Job.getExcept()
        Parameters:
        except - Job will run except for when these filtering options match.
        Returns:
        this
      • except

        @Stability(Experimental)
        public Job.Builder except​(Filter except)
        Sets the value of Job.getExcept()
        Parameters:
        except - Job will run except for when these filtering options match.
        Returns:
        this
      • extendsValue

        @Stability(Experimental)
        public Job.Builder extendsValue​(List<String> extendsValue)
        Sets the value of Job.getExtendsValue()
        Parameters:
        extendsValue - The name of one or more jobs to inherit configuration from.
        Returns:
        this
      • idTokens

        @Stability(Experimental)
        public Job.Builder idTokens​(Map<String,​? extends IDToken> idTokens)
        Sets the value of Job.getIdTokens()
        Parameters:
        idTokens - Configurable ID tokens (JSON Web Tokens) that are used for CI/CD authentication.
        Returns:
        this
      • image

        @Stability(Experimental)
        public Job.Builder image​(Image image)
        Sets the value of Job.getImage()
        Parameters:
        image - the value to be set.
        Returns:
        this
      • inherit

        @Stability(Experimental)
        public Job.Builder inherit​(Inherit inherit)
        Sets the value of Job.getInherit()
        Parameters:
        inherit - Controls inheritance of globally-defined defaults and variables. Boolean values control inheritance of all default: or variables: keywords. To inherit only a subset of default: or variables: keywords, specify what you wish to inherit. Anything not listed is not inherited.
        Returns:
        this
      • interruptible

        @Stability(Experimental)
        public Job.Builder interruptible​(Boolean interruptible)
        Sets the value of Job.getInterruptible()
        Parameters:
        interruptible - the value to be set.
        Returns:
        this
      • needs

        @Stability(Experimental)
        public Job.Builder needs​(List<? extends Object> needs)
        Sets the value of Job.getNeeds()
        Parameters:
        needs - The list of jobs in previous stages whose sole completion is needed to start the current job.
        Returns:
        this
      • only

        @Stability(Experimental)
        public Job.Builder only​(List<String> only)
        Sets the value of Job.getOnly()
        Parameters:
        only - Job will run only when these filtering options match.
        Returns:
        this
      • only

        @Stability(Experimental)
        public Job.Builder only​(Filter only)
        Sets the value of Job.getOnly()
        Parameters:
        only - Job will run only when these filtering options match.
        Returns:
        this
      • parallel

        @Stability(Experimental)
        public Job.Builder parallel​(Number parallel)
        Sets the value of Job.getParallel()
        Parameters:
        parallel - Parallel will split up a single job into several, and provide CI_NODE_INDEX and CI_NODE_TOTAL environment variables for the running jobs.
        Returns:
        this
      • parallel

        @Stability(Experimental)
        public Job.Builder parallel​(Parallel parallel)
        Sets the value of Job.getParallel()
        Parameters:
        parallel - Parallel will split up a single job into several, and provide CI_NODE_INDEX and CI_NODE_TOTAL environment variables for the running jobs.
        Returns:
        this
      • release

        @Stability(Experimental)
        public Job.Builder release​(Release release)
        Sets the value of Job.getRelease()
        Parameters:
        release - Indicates that the job creates a Release.
        Returns:
        this
      • resourceGroup

        @Stability(Experimental)
        public Job.Builder resourceGroup​(String resourceGroup)
        Sets the value of Job.getResourceGroup()
        Parameters:
        resourceGroup - Limit job concurrency. Can be used to ensure that the Runner will not run certain jobs simultaneously.
        Returns:
        this
      • retry

        @Stability(Experimental)
        public Job.Builder retry​(Retry retry)
        Sets the value of Job.getRetry()
        Parameters:
        retry - the value to be set.
        Returns:
        this
      • rules

        @Stability(Experimental)
        public Job.Builder rules​(List<? extends IncludeRule> rules)
        Sets the value of Job.getRules()
        Parameters:
        rules - Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
        Returns:
        this
      • script

        @Stability(Experimental)
        public Job.Builder script​(List<String> script)
        Sets the value of Job.getScript()
        Parameters:
        script - Shell scripts executed by the Runner. The only required property of jobs. Be careful with special characters (e.g. :, {, }, &) and use single or double quotes to avoid issues.
        Returns:
        this
      • services

        @Stability(Experimental)
        public Job.Builder services​(List<? extends Service> services)
        Sets the value of Job.getServices()
        Parameters:
        services - the value to be set.
        Returns:
        this
      • stage

        @Stability(Experimental)
        public Job.Builder stage​(String stage)
        Sets the value of Job.getStage()
        Parameters:
        stage - Define what stage the job will run in.
        Returns:
        this
      • startIn

        @Stability(Experimental)
        public Job.Builder startIn​(String startIn)
        Sets the value of Job.getStartIn()
        Parameters:
        startIn - the value to be set.
        Returns:
        this
      • timeout

        @Stability(Experimental)
        public Job.Builder timeout​(String timeout)
        Sets the value of Job.getTimeout()
        Parameters:
        timeout - the value to be set.
        Returns:
        this
      • trigger

        @Stability(Experimental)
        public Job.Builder trigger​(String trigger)
        Sets the value of Job.getTrigger()
        Parameters:
        trigger - Trigger allows you to define downstream pipeline trigger. When a job created from trigger definition is started by GitLab, a downstream pipeline gets created. Read more: https://docs.gitlab.com/ee/ci/yaml/README.html#trigger
        Returns:
        this
      • trigger

        @Stability(Experimental)
        public Job.Builder trigger​(Trigger trigger)
        Sets the value of Job.getTrigger()
        Parameters:
        trigger - Trigger allows you to define downstream pipeline trigger. When a job created from trigger definition is started by GitLab, a downstream pipeline gets created. Read more: https://docs.gitlab.com/ee/ci/yaml/README.html#trigger
        Returns:
        this
      • variables

        @Stability(Experimental)
        public Job.Builder variables​(Map<String,​String> variables)
        Sets the value of Job.getVariables()
        Parameters:
        variables - Configurable values that are passed to the Job.
        Returns:
        this
      • when

        @Stability(Experimental)
        public Job.Builder when​(JobWhen when)
        Sets the value of Job.getWhen()
        Parameters:
        when - Describes the conditions for when to run the job. Defaults to 'on_success'.
        Returns:
        this
      • build

        @Stability(Experimental)
        public Job build()
        Builds the configured instance.
        Specified by:
        build in interface software.amazon.jsii.Builder<Job>
        Returns:
        a new instance of Job
        Throws:
        NullPointerException - if any required attribute was not provided