Package io.github.cdklabs.projen.gitlab
Class Job.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.gitlab.Job.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
afterScript
@Stability(Experimental) public Job.Builder afterScript(List<String> afterScript)
Sets the value ofJob.getAfterScript()- Parameters:
afterScript- the value to be set.- Returns:
this
-
allowFailure
@Stability(Experimental) public Job.Builder allowFailure(Boolean allowFailure)
Sets the value ofJob.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 ofJob.getAllowFailure()- Parameters:
allowFailure- Whether to allow the pipeline to continue running on job failure (Default: false).- Returns:
this
-
artifacts
@Stability(Experimental) public Job.Builder artifacts(Artifacts artifacts)
Sets the value ofJob.getArtifacts()- Parameters:
artifacts- the value to be set.- Returns:
this
-
beforeScript
@Stability(Experimental) public Job.Builder beforeScript(List<String> beforeScript)
Sets the value ofJob.getBeforeScript()- Parameters:
beforeScript- the value to be set.- Returns:
this
-
cache
@Stability(Experimental) public Job.Builder cache(List<? extends Cache> cache)
Sets the value ofJob.getCache()- Parameters:
cache- the value to be set.- Returns:
this
-
coverage
@Stability(Experimental) public Job.Builder coverage(String coverage)
Sets the value ofJob.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 ofJob.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 ofJob.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 ofJob.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 ofJob.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 ofJob.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 ofJob.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 ofJob.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 ofJob.getImage()- Parameters:
image- the value to be set.- Returns:
this
-
inherit
@Stability(Experimental) public Job.Builder inherit(Inherit inherit)
Sets the value ofJob.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 ofJob.getInterruptible()- Parameters:
interruptible- the value to be set.- Returns:
this
-
needs
@Stability(Experimental) public Job.Builder needs(List<? extends Object> needs)
Sets the value ofJob.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 ofJob.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 ofJob.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 ofJob.getParallel()- Parameters:
parallel- Parallel will split up a single job into several, and provideCI_NODE_INDEXandCI_NODE_TOTALenvironment variables for the running jobs.- Returns:
this
-
parallel
@Stability(Experimental) public Job.Builder parallel(Parallel parallel)
Sets the value ofJob.getParallel()- Parameters:
parallel- Parallel will split up a single job into several, and provideCI_NODE_INDEXandCI_NODE_TOTALenvironment variables for the running jobs.- Returns:
this
-
release
@Stability(Experimental) public Job.Builder release(Release release)
Sets the value ofJob.getRelease()- Parameters:
release- Indicates that the job creates a Release.- Returns:
this
-
resourceGroup
@Stability(Experimental) public Job.Builder resourceGroup(String resourceGroup)
Sets the value ofJob.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 ofJob.getRetry()- Parameters:
retry- the value to be set.- Returns:
this
-
rules
@Stability(Experimental) public Job.Builder rules(List<? extends IncludeRule> rules)
Sets the value ofJob.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 ofJob.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
-
secrets
@Stability(Experimental) public Job.Builder secrets(Map<String,? extends Map<String,? extends Secret>> secrets)
Sets the value ofJob.getSecrets()- Parameters:
secrets- CI/CD secrets.- Returns:
this
-
services
@Stability(Experimental) public Job.Builder services(List<? extends Service> services)
Sets the value ofJob.getServices()- Parameters:
services- the value to be set.- Returns:
this
-
stage
@Stability(Experimental) public Job.Builder stage(String stage)
Sets the value ofJob.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 ofJob.getStartIn()- Parameters:
startIn- the value to be set.- Returns:
this
-
tags
@Stability(Experimental) public Job.Builder tags(List<String> tags)
Sets the value ofJob.getTags()- Parameters:
tags- the value to be set.- Returns:
this
-
timeout
@Stability(Experimental) public Job.Builder timeout(String timeout)
Sets the value ofJob.getTimeout()- Parameters:
timeout- the value to be set.- Returns:
this
-
trigger
@Stability(Experimental) public Job.Builder trigger(String trigger)
Sets the value ofJob.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 ofJob.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 ofJob.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 ofJob.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:
buildin interfacesoftware.amazon.jsii.Builder<Job>- Returns:
- a new instance of
Job - Throws:
NullPointerException- if any required attribute was not provided
-
-