Class CiConfiguration

  • All Implemented Interfaces:
    software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
    Direct Known Subclasses:
    GitlabConfiguration, NestedConfiguration

    @Generated(value="jsii-pacmak/1.96.0 (build 921e240)",
               date="2024-03-28T21:16:43.117Z")
    @Stability(Experimental)
    public class CiConfiguration
    extends Component
    (experimental) CI for GitLab.

    A CI is a configurable automated process made up of one or more stages/jobs.

    See Also:
    https://docs.gitlab.com/ee/ci/yaml/
    • Constructor Detail

      • CiConfiguration

        protected CiConfiguration​(software.amazon.jsii.JsiiObjectRef objRef)
      • CiConfiguration

        protected CiConfiguration​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
      • CiConfiguration

        @Stability(Experimental)
        public CiConfiguration​(@NotNull
                               Project project,
                               @NotNull
                               String name,
                               @Nullable
                               CiConfigurationOptions options)
        Parameters:
        project - This parameter is required.
        name - This parameter is required.
        options -
      • CiConfiguration

        @Stability(Experimental)
        public CiConfiguration​(@NotNull
                               Project project,
                               @NotNull
                               String name)
        Parameters:
        project - This parameter is required.
        name - This parameter is required.
    • Method Detail

      • addDefaultCaches

        @Stability(Experimental)
        public void addDefaultCaches​(@NotNull
                                     List<Cache> caches)
        (experimental) Adds up to 4 default caches configuration to the CI configuration.

        Parameters:
        caches - Caches to add. This parameter is required.
      • addGlobalVariables

        @Stability(Experimental)
        public void addGlobalVariables​(@NotNull
                                       Map<String,​Object> variables)
        (experimental) Add a globally defined variable to the CI configuration.

        Parameters:
        variables - The variables to add. This parameter is required.
      • addIncludes

        @Stability(Experimental)
        public void addIncludes​(@NotNull
                                @NotNull Include... includes)
        (experimental) Add additional yml/yaml files to the CI includes.

        Parameters:
        includes - The includes to add. This parameter is required.
      • addJobs

        @Stability(Experimental)
        public void addJobs​(@NotNull
                            Map<String,​Job> jobs)
        (experimental) Add jobs and their stages to the CI configuration.

        Parameters:
        jobs - Jobs to add. This parameter is required.
      • addServices

        @Stability(Experimental)
        public void addServices​(@NotNull
                                @NotNull Service... services)
        (experimental) Add additional services.

        Parameters:
        services - The services to add. This parameter is required.
      • addStages

        @Stability(Experimental)
        public void addStages​(@NotNull
                              @NotNull String... stages)
        (experimental) Add stages to the CI configuration if not already present.

        Parameters:
        stages - stages to add. This parameter is required.
      • getDefaultAfterScript

        @Stability(Experimental)
        @NotNull
        public List<String> getDefaultAfterScript()
        (experimental) Defines default scripts that should run after all jobs.

        Can be overriden by the job level afterScript.

      • getDefaultBeforeScript

        @Stability(Experimental)
        @NotNull
        public List<String> getDefaultBeforeScript()
        (experimental) Defines default scripts that should run before all jobs.

        Can be overriden by the job level afterScript.

      • getDefaultTags

        @Stability(Experimental)
        @NotNull
        public List<String> getDefaultTags()
        (experimental) Used to select a specific runner from the list of all runners that are available for the project.
      • getFile

        @Stability(Experimental)
        @NotNull
        public YamlFile getFile()
        (experimental) The workflow YAML file.
      • getJobs

        @Stability(Experimental)
        @NotNull
        public Map<String,​Job> getJobs()
        (experimental) The jobs in the CI configuration.
      • getName

        @Stability(Experimental)
        @NotNull
        public String getName()
        (experimental) The name of the configuration.
      • getPath

        @Stability(Experimental)
        @NotNull
        public String getPath()
        (experimental) Path to CI file generated by the configuration.
      • getStages

        @Stability(Experimental)
        @NotNull
        public List<String> getStages()
        (experimental) Groups jobs into stages.

        All jobs in one stage must complete before next stage is executed. Defaults to ['build', 'test', 'deploy'].

      • getVariables

        @Stability(Experimental)
        @NotNull
        public Map<String,​Object> getVariables()
        (experimental) Global variables that are passed to jobs.

        If the job already has that variable defined, the job-level variable takes precedence.

      • getDefaultArtifacts

        @Stability(Experimental)
        @Nullable
        public Artifacts getDefaultArtifacts()
        (experimental) Default list of files and directories that should be attached to the job if it succeeds.

        Artifacts are sent to Gitlab where they can be downloaded.

      • getDefaultCache

        @Stability(Experimental)
        @Nullable
        public List<Cache> getDefaultCache()
      • getDefaultImage

        @Stability(Experimental)
        @Nullable
        public Image getDefaultImage()
        (experimental) Specifies the default docker image to use globally for all jobs.
      • getDefaultInterruptible

        @Stability(Experimental)
        @Nullable
        public Boolean getDefaultInterruptible()
        (experimental) The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
      • getDefaultRetry

        @Stability(Experimental)
        @Nullable
        public Retry getDefaultRetry()
        (experimental) How many times a job is retried if it fails.

        If not defined, defaults to 0 and jobs do not retry.

      • getDefaultTimeout

        @Stability(Experimental)
        @Nullable
        public String getDefaultTimeout()
        (experimental) A default timeout job written in natural language (Ex.

        one hour, 3600 seconds, 60 minutes).

      • getPages

        @Stability(Experimental)
        @Nullable
        public Job getPages()
        (experimental) A special job used to upload static sites to Gitlab pages.

        Requires a public/ directory with artifacts.path pointing to it.

      • getWorkflow

        @Stability(Experimental)
        @Nullable
        public Workflow getWorkflow()
        (experimental) Used to control pipeline behavior.