gitlab Submodule
Constructs
CiConfiguration
CI for GitLab.
A CI is a configurable automated process made up of one or more stages/jobs.
Initializers
import { gitlab } from 'projen'
new gitlab.CiConfiguration(project: Project, name: string, options?: CiConfigurationOptions)
| Name | Type | Description |
|---|---|---|
| projen.Project | No description. |
| string | No description. |
| | No description. |
projectRequired
- Type: projen.Project
nameRequired
- Type: string
optionsOptional
- Type: CiConfigurationOptions
Methods
| Name | Description |
|---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds up to 4 default caches configuration to the CI configuration. |
| Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script. |
| Add a globally defined variable to the CI configuration. |
| Add additional yml/yaml files to the CI includes. |
| Add jobs and their stages to the CI configuration. |
| Add additional services. |
| Add stages to the CI configuration if not already present. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addDefaultCaches
public addDefaultCaches(caches: Cache[]): void
Adds up to 4 default caches configuration to the CI configuration.
cachesRequired
- Type: Cache[]
Caches to add.
addDefaultHooks
public addDefaultHooks(hooks: DefaultHooks): void
Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script.
hooksRequired
- Type: DefaultHooks
addGlobalVariables
public addGlobalVariables(variables: {[ key: string ]: any}): void
Add a globally defined variable to the CI configuration.
variablesRequired
- Type: {[ key: string ]: any}
The variables to add.
addIncludes
public addIncludes(includes: ...Include[]): void
Add additional yml/yaml files to the CI includes.
includesRequired
- Type: ...Include[]
The includes to add.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Add jobs and their stages to the CI configuration.
jobsRequired
- Type: {[ key: string ]: Job}
Jobs to add.
addServices
public addServices(services: ...Service[]): void
Add additional services.
servicesRequired
- Type: ...Service[]
The services to add.
addStages
public addStages(stages: ...string[]): void
Add stages to the CI configuration if not already present.
stagesRequired
- Type: ...string[]
stages to add.
Static Functions
| Name | Description |
|---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { gitlab } from 'projen'
gitlab.CiConfiguration.isConstruct(x: any)
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
xRequired
- Type: any
Any object.
isComponent
import { gitlab } from 'projen'
gitlab.CiConfiguration.isComponent(x: any)
Test whether the given construct is a component.
xRequired
- Type: any
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Defines default scripts that should run after all jobs. |
| string[] | Defines default scripts that should run before all jobs. |
| string[] | Used to select a specific runner from the list of all runners that are available for the project. |
| projen.YamlFile | The workflow YAML file. |
| | The jobs in the CI configuration. |
| string | The name of the configuration. |
| string | Path to CI file generated by the configuration. |
| string[] | Groups jobs into stages. |
| | Global variables that are passed to jobs. |
| | Default list of files and directories that should be attached to the job if it succeeds. |
| | No description. |
| | Default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs. |
| | Specifies the default docker image to use globally for all jobs. |
| boolean | The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false). |
| | How many times a job is retried if it fails. |
| string | A default timeout job written in natural language (Ex. |
| | A special job used to upload static sites to Gitlab pages. |
| | Used to control pipeline behavior. |
nodeRequired
public readonly node: Node;
- Type: constructs.Node
The tree node.
projectRequired
public readonly project: Project;
- Type: projen.Project
defaultAfterScriptRequired
public readonly defaultAfterScript: string[];
- Type: string[]
Defines default scripts that should run after all jobs.
Can be overriden by the job level afterScript.
defaultBeforeScriptRequired
public readonly defaultBeforeScript: string[];
- Type: string[]
Defines default scripts that should run before all jobs.
Can be overriden by the job level afterScript.
defaultTagsRequired
public readonly defaultTags: string[];
- Type: string[]
Used to select a specific runner from the list of all runners that are available for the project.
fileRequired
public readonly file: YamlFile;
- Type: projen.YamlFile
The workflow YAML file.
jobsRequired
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
The jobs in the CI configuration.
nameRequired
public readonly name: string;
- Type: string
The name of the configuration.
pathRequired
public readonly path: string;
- Type: string
Path to CI file generated by the configuration.
stagesRequired
public readonly stages: string[];
- Type: string[]
Groups jobs into stages.
All jobs in one stage must complete before next stage is executed. Defaults to ['build', 'test', 'deploy'].
variablesRequired
public readonly variables: {[ key: string ]: string | number | VariableConfig};
- Type: {[ key: string ]: string | number | VariableConfig}
Global variables that are passed to jobs.
If the job already has that variable defined, the job-level variable takes precedence.
defaultArtifactsOptional
public readonly defaultArtifacts: Artifacts;
- Type: Artifacts
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.
defaultCacheOptional
public readonly defaultCache: Cache[];
- Type: Cache[]
defaultIdTokensOptional
public readonly defaultIdTokens: {[ key: string ]: IDToken};
- Type: {[ key: string ]: IDToken}
Default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs.
defaultImageOptional
public readonly defaultImage: Image;
- Type: Image
Specifies the default docker image to use globally for all jobs.
defaultInterruptibleOptional
public readonly defaultInterruptible: boolean;
- Type: boolean
The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
defaultRetryOptional
public readonly defaultRetry: Retry;
- Type: Retry
How many times a job is retried if it fails.
If not defined, defaults to 0 and jobs do not retry.
defaultTimeoutOptional
public readonly defaultTimeout: string;
- Type: string
A default timeout job written in natural language (Ex.
one hour, 3600 seconds, 60 minutes).
pagesOptional
public readonly pages: Job;
- Type: Job
A special job used to upload static sites to Gitlab pages.
Requires a public/ directory
with artifacts.path pointing to it.
workflowOptional
public readonly workflow: Workflow;
- Type: Workflow
Used to control pipeline behavior.
GitlabConfiguration
A GitLab CI for the main .gitlab-ci.yml file.
Initializers
import { gitlab } from 'projen'
new gitlab.GitlabConfiguration(project: Project, options?: CiConfigurationOptions)
| Name | Type | Description |
|---|---|---|
| projen.Project | No description. |
| | No description. |
projectRequired
- Type: projen.Project
optionsOptional
- Type: CiConfigurationOptions
Methods
| Name | Description |
|---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds up to 4 default caches configuration to the CI configuration. |
| Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script. |
| Add a globally defined variable to the CI configuration. |
| Add additional yml/yaml files to the CI includes. |
| Add jobs and their stages to the CI configuration. |
| Add additional services. |
| Add stages to the CI configuration if not already present. |
| Creates and adds nested templates to the includes of the main CI. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addDefaultCaches
public addDefaultCaches(caches: Cache[]): void
Adds up to 4 default caches configuration to the CI configuration.
cachesRequired
- Type: Cache[]
Caches to add.
addDefaultHooks
public addDefaultHooks(hooks: DefaultHooks): void
Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script.
hooksRequired
- Type: DefaultHooks
addGlobalVariables
public addGlobalVariables(variables: {[ key: string ]: any}): void
Add a globally defined variable to the CI configuration.
variablesRequired
- Type: {[ key: string ]: any}
The variables to add.
addIncludes
public addIncludes(includes: ...Include[]): void
Add additional yml/yaml files to the CI includes.
includesRequired
- Type: ...Include[]
The includes to add.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Add jobs and their stages to the CI configuration.
jobsRequired
- Type: {[ key: string ]: Job}
Jobs to add.
addServices
public addServices(services: ...Service[]): void
Add additional services.
servicesRequired
- Type: ...Service[]
The services to add.
addStages
public addStages(stages: ...string[]): void
Add stages to the CI configuration if not already present.
stagesRequired
- Type: ...string[]
stages to add.
createNestedTemplates
public createNestedTemplates(config: {[ key: string ]: CiConfigurationOptions}): void
Creates and adds nested templates to the includes of the main CI.
Additionally adds their stages to the main CI if they are not already present.
You can futher customize nested templates through the nestedTemplates property.
E.g. gitlabConfig.nestedTemplates['templateName']?.addStages('stageName')
configRequired
- Type: {[ key: string ]: CiConfigurationOptions}
a record the names and configuraitons of the templates.
Static Functions
| Name | Description |
|---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { gitlab } from 'projen'
gitlab.GitlabConfiguration.isConstruct(x: any)
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
xRequired
- Type: any
Any object.
isComponent
import { gitlab } from 'projen'
gitlab.GitlabConfiguration.isComponent(x: any)
Test whether the given construct is a component.
xRequired
- Type: any
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Defines default scripts that should run after all jobs. |
| string[] | Defines default scripts that should run before all jobs. |
| string[] | Used to select a specific runner from the list of all runners that are available for the project. |
| projen.YamlFile | The workflow YAML file. |
| | The jobs in the CI configuration. |
| string | The name of the configuration. |
| string | Path to CI file generated by the configuration. |
| string[] | Groups jobs into stages. |
| | Global variables that are passed to jobs. |
| | Default list of files and directories that should be attached to the job if it succeeds. |
| | No description. |
| | Default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs. |
| | Specifies the default docker image to use globally for all jobs. |
| boolean | The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false). |
| | How many times a job is retried if it fails. |
| string | A default timeout job written in natural language (Ex. |
| | A special job used to upload static sites to Gitlab pages. |
| | Used to control pipeline behavior. |
| | No description. |
nodeRequired
public readonly node: Node;
- Type: constructs.Node
The tree node.
projectRequired
public readonly project: Project;
- Type: projen.Project
defaultAfterScriptRequired
public readonly defaultAfterScript: string[];
- Type: string[]
Defines default scripts that should run after all jobs.
Can be overriden by the job level afterScript.
defaultBeforeScriptRequired
public readonly defaultBeforeScript: string[];
- Type: string[]
Defines default scripts that should run before all jobs.
Can be overriden by the job level afterScript.
defaultTagsRequired
public readonly defaultTags: string[];
- Type: string[]
Used to select a specific runner from the list of all runners that are available for the project.
fileRequired
public readonly file: YamlFile;
- Type: projen.YamlFile
The workflow YAML file.
jobsRequired
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
The jobs in the CI configuration.
nameRequired
public readonly name: string;
- Type: string
The name of the configuration.
pathRequired
public readonly path: string;
- Type: string
Path to CI file generated by the configuration.
stagesRequired
public readonly stages: string[];
- Type: string[]
Groups jobs into stages.
All jobs in one stage must complete before next stage is executed. Defaults to ['build', 'test', 'deploy'].
variablesRequired
public readonly variables: {[ key: string ]: string | number | VariableConfig};
- Type: {[ key: string ]: string | number | VariableConfig}
Global variables that are passed to jobs.
If the job already has that variable defined, the job-level variable takes precedence.
defaultArtifactsOptional
public readonly defaultArtifacts: Artifacts;
- Type: Artifacts
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.
defaultCacheOptional
public readonly defaultCache: Cache[];
- Type: Cache[]
defaultIdTokensOptional
public readonly defaultIdTokens: {[ key: string ]: IDToken};
- Type: {[ key: string ]: IDToken}
Default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs.
defaultImageOptional
public readonly defaultImage: Image;
- Type: Image
Specifies the default docker image to use globally for all jobs.
defaultInterruptibleOptional
public readonly defaultInterruptible: boolean;
- Type: boolean
The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
defaultRetryOptional
public readonly defaultRetry: Retry;
- Type: Retry
How many times a job is retried if it fails.
If not defined, defaults to 0 and jobs do not retry.
defaultTimeoutOptional
public readonly defaultTimeout: string;
- Type: string
A default timeout job written in natural language (Ex.
one hour, 3600 seconds, 60 minutes).
pagesOptional
public readonly pages: Job;
- Type: Job
A special job used to upload static sites to Gitlab pages.
Requires a public/ directory
with artifacts.path pointing to it.
workflowOptional
public readonly workflow: Workflow;
- Type: Workflow
Used to control pipeline behavior.
nestedTemplatesRequired
public readonly nestedTemplates: {[ key: string ]: NestedConfiguration};
- Type: {[ key: string ]: NestedConfiguration}
NestedConfiguration
A GitLab CI for templates that are created and included in the .gitlab-ci.yml file.
Initializers
import { gitlab } from 'projen'
new gitlab.NestedConfiguration(project: Project, parent: GitlabConfiguration, name: string, options?: CiConfigurationOptions)
| Name | Type | Description |
|---|---|---|
| projen.Project | No description. |
| | No description. |
| string | The name of the configuration. |
| | No description. |
projectRequired
- Type: projen.Project
parentRequired
- Type: GitlabConfiguration
nameRequired
- Type: string
The name of the configuration.
optionsOptional
- Type: CiConfigurationOptions
Methods
| Name | Description |
|---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds up to 4 default caches configuration to the CI configuration. |
| Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script. |
| Add a globally defined variable to the CI configuration. |
| Add additional yml/yaml files to the CI includes. |
| Add jobs and their stages to the CI configuration. |
| Add additional services. |
| Add stages to the CI configuration if not already present. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addDefaultCaches
public addDefaultCaches(caches: Cache[]): void
Adds up to 4 default caches configuration to the CI configuration.
cachesRequired
- Type: Cache[]
Caches to add.
addDefaultHooks
public addDefaultHooks(hooks: DefaultHooks): void
Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script.
hooksRequired
- Type: DefaultHooks
addGlobalVariables
public addGlobalVariables(variables: {[ key: string ]: any}): void
Add a globally defined variable to the CI configuration.
variablesRequired
- Type: {[ key: string ]: any}
The variables to add.
addIncludes
public addIncludes(includes: ...Include[]): void
Add additional yml/yaml files to the CI includes.
includesRequired
- Type: ...Include[]
The includes to add.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Add jobs and their stages to the CI configuration.
jobsRequired
- Type: {[ key: string ]: Job}
Jobs to add.
addServices
public addServices(services: ...Service[]): void
Add additional services.
servicesRequired
- Type: ...Service[]
The services to add.
addStages
public addStages(stages: ...string[]): void
Add stages to the CI configuration if not already present.
stagesRequired
- Type: ...string[]
stages to add.
Static Functions
| Name | Description |
|---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { gitlab } from 'projen'
gitlab.NestedConfiguration.isConstruct(x: any)
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
xRequired
- Type: any
Any object.
isComponent
import { gitlab } from 'projen'
gitlab.NestedConfiguration.isComponent(x: any)
Test whether the given construct is a component.
xRequired
- Type: any
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string[] | Defines default scripts that should run after all jobs. |
| string[] | Defines default scripts that should run before all jobs. |
| string[] | Used to select a specific runner from the list of all runners that are available for the project. |
| projen.YamlFile | The workflow YAML file. |
| | The jobs in the CI configuration. |
| string | The name of the configuration. |
| string | Path to CI file generated by the configuration. |
| string[] | Groups jobs into stages. |
| | Global variables that are passed to jobs. |
| | Default list of files and directories that should be attached to the job if it succeeds. |
| | No description. |
| | Default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs. |
| | Specifies the default docker image to use globally for all jobs. |
| boolean | The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false). |
| | How many times a job is retried if it fails. |
| string | A default timeout job written in natural language (Ex. |
| | A special job used to upload static sites to Gitlab pages. |
| | Used to control pipeline behavior. |
| | No description. |
nodeRequired
public readonly node: Node;
- Type: constructs.Node
The tree node.
projectRequired
public readonly project: Project;
- Type: projen.Project
defaultAfterScriptRequired
public readonly defaultAfterScript: string[];
- Type: string[]
Defines default scripts that should run after all jobs.
Can be overriden by the job level afterScript.
defaultBeforeScriptRequired
public readonly defaultBeforeScript: string[];
- Type: string[]
Defines default scripts that should run before all jobs.
Can be overriden by the job level afterScript.
defaultTagsRequired
public readonly defaultTags: string[];
- Type: string[]
Used to select a specific runner from the list of all runners that are available for the project.
fileRequired
public readonly file: YamlFile;
- Type: projen.YamlFile
The workflow YAML file.
jobsRequired
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
The jobs in the CI configuration.
nameRequired
public readonly name: string;
- Type: string
The name of the configuration.
pathRequired
public readonly path: string;
- Type: string
Path to CI file generated by the configuration.
stagesRequired
public readonly stages: string[];
- Type: string[]
Groups jobs into stages.
All jobs in one stage must complete before next stage is executed. Defaults to ['build', 'test', 'deploy'].
variablesRequired
public readonly variables: {[ key: string ]: string | number | VariableConfig};
- Type: {[ key: string ]: string | number | VariableConfig}
Global variables that are passed to jobs.
If the job already has that variable defined, the job-level variable takes precedence.
defaultArtifactsOptional
public readonly defaultArtifacts: Artifacts;
- Type: Artifacts
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.
defaultCacheOptional
public readonly defaultCache: Cache[];
- Type: Cache[]
defaultIdTokensOptional
public readonly defaultIdTokens: {[ key: string ]: IDToken};
- Type: {[ key: string ]: IDToken}
Default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs.
defaultImageOptional
public readonly defaultImage: Image;
- Type: Image
Specifies the default docker image to use globally for all jobs.
defaultInterruptibleOptional
public readonly defaultInterruptible: boolean;
- Type: boolean
The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
defaultRetryOptional
public readonly defaultRetry: Retry;
- Type: Retry
How many times a job is retried if it fails.
If not defined, defaults to 0 and jobs do not retry.
defaultTimeoutOptional
public readonly defaultTimeout: string;
- Type: string
A default timeout job written in natural language (Ex.
one hour, 3600 seconds, 60 minutes).
pagesOptional
public readonly pages: Job;
- Type: Job
A special job used to upload static sites to Gitlab pages.
Requires a public/ directory
with artifacts.path pointing to it.
workflowOptional
public readonly workflow: Workflow;
- Type: Workflow
Used to control pipeline behavior.
parentRequired
public readonly parent: GitlabConfiguration;
- Type: GitlabConfiguration
Structs
AllowFailure
Exit code that are not considered failure.
The job fails for any other exit code. You can list which exit codes are not considered failures. The job fails for any other exit code.
Initializer
import { gitlab } from 'projen'
const allowFailure: gitlab.AllowFailure = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| number | number[] | No description. |
exitCodesRequired
public readonly exitCodes: number | number[];
- Type: number | number[]
Artifacts
Used to specify a 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.
Initializer
import { gitlab } from 'projen'
const artifacts: gitlab.Artifacts = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | A list of paths to files/folders that should be excluded in the artifact. |
| string | How long artifacts should be kept. |
| string | Can be used to expose job artifacts in the merge request UI. |
| string | Name for the archive created on job success. |
| string[] | A list of paths to files/folders that should be included in the artifact. |
| | Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests. |
| boolean | Whether to add all untracked files (along with 'artifacts.paths') to the artifact. |
| | Configure when artifacts are uploaded depended on job status. |
excludeOptional
public readonly exclude: string[];
- Type: string[]
A list of paths to files/folders that should be excluded in the artifact.
expireInOptional
public readonly expireIn: string;
- Type: string
How long artifacts should be kept.
They are saved 30 days by default. Artifacts that have expired are removed periodically via cron job. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'.
exposeAsOptional
public readonly exposeAs: string;
- Type: string
Can be used to expose job artifacts in the merge request UI.
GitLab will add a link <expose_as> to the relevant merge request that points to the artifact.
nameOptional
public readonly name: string;
- Type: string
Name for the archive created on job success.
Can use variables in the name, e.g. '$CI_JOB_NAME'
pathsOptional
public readonly paths: string[];
- Type: string[]
A list of paths to files/folders that should be included in the artifact.
reportsOptional
public readonly reports: Reports;
- Type: Reports
Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests.
untrackedOptional
public readonly untracked: boolean;
- Type: boolean
Whether to add all untracked files (along with 'artifacts.paths') to the artifact.
whenOptional
public readonly when: CacheWhen;
- Type: CacheWhen
Configure when artifacts are uploaded depended on job status.
Assets
Asset configuration for a release.
Initializer
import { gitlab } from 'projen'
const assets: gitlab.Assets = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| | Include asset links in the release. |
linksRequired
public readonly links: Link[];
- Type: Link[]
Include asset links in the release.
Cache
Cache Definition.
Initializer
import { gitlab } from 'projen'
const cache: gitlab.Cache = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Use cache:fallback_keys to specify a list of keys to try to restore cache from if there is no cache found for the cache:key. |
| | Used the to give each cache a unique identifying key. |
| string[] | Defines which files or directories to cache. |
| | Defines the upload and download behaviour of the cache. |
| boolean | If set to true all files that are untracked in your Git repository will be cached. |
| | Defines when to save the cache, based on the status of the job (Default: Job Success). |
fallbackKeysOptional
public readonly fallbackKeys: string[];
- Type: string[]
Use cache:fallback_keys to specify a list of keys to try to restore cache from if there is no cache found for the cache:key.
Caches are retrieved in the order specified in the fallback_keys section.
keyOptional
public readonly key: string | CacheKeyFiles;
- Type: string | CacheKeyFiles
Used the to give each cache a unique identifying key.
All jobs that use the same cache key use the same cache.
pathsOptional
public readonly paths: string[];
- Type: string[]
Defines which files or directories to cache.
policyOptional
public readonly policy: CachePolicy;
- Type: CachePolicy
Defines the upload and download behaviour of the cache.
untrackedOptional
public readonly untracked: boolean;
- Type: boolean
If set to true all files that are untracked in your Git repository will be cached.
whenOptional
public readonly when: CacheWhen;
- Type: CacheWhen
Defines when to save the cache, based on the status of the job (Default: Job Success).
CacheKeyFiles
Use this construct to generate a new key when one or two specific files change.
Initializer
import { gitlab } from 'projen'
const cacheKeyFiles: gitlab.CacheKeyFiles = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | The files that are checked against. |
| string | Adds a custom prefix to the checksums computed. |
filesRequired
public readonly files: string[];
- Type: string[]
The files that are checked against.
If the SHA checksum changes, the cache becomes invalid.
prefixOptional
public readonly prefix: string;
- Type: string
Adds a custom prefix to the checksums computed.
CiConfigurationOptions
Options for CiConfiguration.
Initializer
import { gitlab } from 'projen'
const ciConfigurationOptions: gitlab.CiConfigurationOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| | Default settings for the CI Configuration. |
| | An initial set of jobs to add to the configuration. |
| | A special job used to upload static sites to Gitlab pages. |
| string | The path of the file to generate. |
| string[] | Groups jobs into stages. |
| {[ key: string ]: any} | Global variables that are passed to jobs. |
| | Used to control pipeline behavior. |
defaultOptional
public readonly default: Default;
- Type: Default
Default settings for the CI Configuration.
Jobs that do not define one or more of the listed keywords use the value defined in the default section.
jobsOptional
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
An initial set of jobs to add to the configuration.
pagesOptional
public readonly pages: Job;
- Type: Job
A special job used to upload static sites to Gitlab pages.
Requires a public/ directory
with artifacts.path pointing to it.
pathOptional
public readonly path: string;
- Type: string
The path of the file to generate.
stagesOptional
public readonly stages: string[];
- Type: string[]
Groups jobs into stages.
All jobs in one stage must complete before next stage is executed. If no stages are specified. Defaults to ['build', 'test', 'deploy'].
variablesOptional
public readonly variables: {[ key: string ]: any};
- Type: {[ key: string ]: any}
Global variables that are passed to jobs.
If the job already has that variable defined, the job-level variable takes precedence.
workflowOptional
public readonly workflow: Workflow;
- Type: Workflow
Used to control pipeline behavior.
CoverageReport
Code coverage report interface.
https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report
Initializer
import { gitlab } from 'projen'
const coverageReport: gitlab.CoverageReport = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | No description. |
| string | No description. |
coverageFormatRequired
public readonly coverageFormat: string;
- Type: string
pathRequired
public readonly path: string;
- Type: string
Default
Default settings for the CI Configuration.
Jobs that do not define one or more of the listed keywords use the value defined in the default section.
Initializer
import { gitlab } from 'projen'
const default: gitlab.Default = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | No description. |
| | No description. |
| string[] | No description. |
| | No description. |
| | Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script. |
| | Specifies the default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs. |
| | No description. |
| boolean | No description. |
| | No description. |
| | No description. |
| string[] | No description. |
| string | No description. |
afterScriptOptional
public readonly afterScript: string[];
- Type: string[]
artifactsOptional
public readonly artifacts: Artifacts;
- Type: Artifacts
beforeScriptOptional
public readonly beforeScript: string[];
- Type: string[]
cacheOptional
public readonly cache: Cache[];
- Type: Cache[]
hooksOptional
public readonly hooks: DefaultHooks;
- Type: DefaultHooks
Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script.
idTokensOptional
public readonly idTokens: {[ key: string ]: IDToken};
- Type: {[ key: string ]: IDToken}
Specifies the default ID tokens (JSON Web Tokens) that are used for CI/CD authentication to use globally for all jobs.
imageOptional
public readonly image: Image;
- Type: Image
interruptibleOptional
public readonly interruptible: boolean;
- Type: boolean
retryOptional
public readonly retry: Retry;
- Type: Retry
servicesOptional
public readonly services: Service[];
- Type: Service[]
tagsOptional
public readonly tags: string[];
- Type: string[]
timeoutOptional
public readonly timeout: string;
- Type: string
DefaultHooks
Initializer
import { gitlab } from 'projen'
const defaultHooks: gitlab.DefaultHooks = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script. |
preGetSourcesScriptOptional
public readonly preGetSourcesScript: string[];
- Type: string[]
Specify a list of commands to execute on the runner before cloning the Git repository and any submodules https://docs.gitlab.com/ci/yaml/#hookspre_get_sources_script.
Engine
The engine configuration for a secret.
Initializer
import { gitlab } from 'projen'
const engine: gitlab.Engine = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Name of the secrets engine. |
| string | Path to the secrets engine. |
nameRequired
public readonly name: string;
- Type: string
Name of the secrets engine.
pathRequired
public readonly path: string;
- Type: string
Path to the secrets engine.
Environment
The environment that a job deploys to.
Initializer
import { gitlab } from 'projen'
const environment: gitlab.Environment = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The name of the environment, e.g. 'qa', 'staging', 'production'. |
| | Specifies what this job will do. |
| string | The amount of time it should take before Gitlab will automatically stop the environment. |
| | Explicitly specifies the tier of the deployment environment if non-standard environment name is used. |
| | Used to configure the kubernetes deployment for this environment. |
| string | The name of a job to execute when the environment is about to be stopped. |
| string | When set, this will expose buttons in various places for the current environment in Gitlab, that will take you to the defined URL. |
nameRequired
public readonly name: string;
- Type: string
The name of the environment, e.g. 'qa', 'staging', 'production'.
actionOptional
public readonly action: Action;
- Type: Action
Specifies what this job will do.
'start' (default) indicates the job will start the deployment. 'prepare' indicates this will not affect the deployment. 'stop' indicates this will stop the deployment.
autoStopInOptional
public readonly autoStopIn: string;
- Type: string
The amount of time it should take before Gitlab will automatically stop the environment.
Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'.
deploymentTierOptional
public readonly deploymentTier: DeploymentTier;
- Type: DeploymentTier
Explicitly specifies the tier of the deployment environment if non-standard environment name is used.
kubernetesOptional
public readonly kubernetes: KubernetesConfig;
- Type: KubernetesConfig
Used to configure the kubernetes deployment for this environment.
This is currently not supported for kubernetes clusters that are managed by Gitlab.
onStopOptional
public readonly onStop: string;
- Type: string
The name of a job to execute when the environment is about to be stopped.
urlOptional
public readonly url: string;
- Type: string
When set, this will expose buttons in various places for the current environment in Gitlab, that will take you to the defined URL.
Filter
Filtering options for when a job will run.
Initializer
import { gitlab } from 'projen'
const filter: gitlab.Filter = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Filter job creation based on files that were modified in a git push. |
| | Filter job based on if Kubernetes integration is active. |
| string[] | Control when to add jobs to a pipeline based on branch names or pipeline types. |
| string[] | Filter job by checking comparing values of environment variables. |
changesOptional
public readonly changes: string[];
- Type: string[]
Filter job creation based on files that were modified in a git push.
kubernetesOptional
public readonly kubernetes: KubernetesEnum;
- Type: KubernetesEnum
Filter job based on if Kubernetes integration is active.
refsOptional
public readonly refs: string[];
- Type: string[]
Control when to add jobs to a pipeline based on branch names or pipeline types.
variablesOptional
public readonly variables: string[];
- Type: string[]
Filter job by checking comparing values of environment variables.
Read more about variable expressions: https://docs.gitlab.com/ee/ci/variables/README.html#variables-expressions
Image
Specifies the docker image to use for the job or globally for all jobs.
Job configuration takes precedence over global setting. Requires a certain kind of Gitlab runner executor.
Initializer
import { gitlab } from 'projen'
const image: gitlab.Image = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Full name of the image that should be used. |
| any[] | Command or script that should be executed as the container's entrypoint. |
nameRequired
public readonly name: string;
- Type: string
Full name of the image that should be used.
It should contain the Registry part if needed.
entrypointOptional
public readonly entrypoint: any[];
- Type: any[]
Command or script that should be executed as the container's entrypoint.
It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array.
Include
An included YAML file.
Initializer
import { gitlab } from 'projen'
const include: gitlab.Include = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Files from another private project on the same GitLab instance. |
| string | Relative path from local repository root (/) to the yaml/yml file template. |
| string | Path to the project, e.g. group/project, or group/sub-group/project. |
| string | Branch/Tag/Commit-hash for the target project. |
| string | URL to a yaml/yml template file using HTTP/HTTPS. |
| | Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job. |
| string | Use a .gitlab-ci.yml template as a base, e.g. Nodejs.gitlab-ci.yml. |
fileOptional
public readonly file: string[];
- Type: string[]
Files from another private project on the same GitLab instance.
You can use file in combination with project only.
localOptional
public readonly local: string;
- Type: string
Relative path from local repository root (/) to the yaml/yml file template.
The file must be on the same branch, and does not work across git submodules.
projectOptional
public readonly project: string;
- Type: string
Path to the project, e.g. group/project, or group/sub-group/project.
refOptional
public readonly ref: string;
- Type: string
Branch/Tag/Commit-hash for the target project.
remoteOptional
public readonly remote: string;
- Type: string
URL to a yaml/yml template file using HTTP/HTTPS.
rulesOptional
public readonly rules: IncludeRule[];
- Type: IncludeRule[]
Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
templateOptional
public readonly template: string;
- Type: string
Use a .gitlab-ci.yml template as a base, e.g. Nodejs.gitlab-ci.yml.
IncludeRule
Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
https://docs.gitlab.com/ee/ci/yaml/includes.html#use-rules-with-include
Initializer
import { gitlab } from 'projen'
const includeRule: gitlab.IncludeRule = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| | No description. |
| string[] | No description. |
| string[] | No description. |
| string | No description. |
| string[] | No description. |
| string | No description. |
| {[ key: string ]: string} | No description. |
| | No description. |
allowFailureOptional
public readonly allowFailure: boolean | AllowFailure;
- Type: boolean | AllowFailure
changesOptional
public readonly changes: string[];
- Type: string[]
existsOptional
public readonly exists: string[];
- Type: string[]
ifOptional
public readonly if: string;
- Type: string
needsOptional
public readonly needs: string[];
- Type: string[]
startInOptional
public readonly startIn: string;
- Type: string
variablesOptional
public readonly variables: {[ key: string ]: string};
- Type: {[ key: string ]: string}
whenOptional
public readonly when: JobWhen;
- Type: JobWhen
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.
Initializer
import { gitlab } from 'projen'
const inherit: gitlab.Inherit = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| | Whether to inherit all globally-defined defaults or not. |
| boolean | string[] | Whether to inherit all globally-defined variables or not. |
defaultOptional
public readonly default: boolean | DefaultElement[];
- Type: boolean | DefaultElement[]
Whether to inherit all globally-defined defaults or not.
Or subset of inherited defaults
variablesOptional
public readonly variables: boolean | string[];
- Type: boolean | string[]
Whether to inherit all globally-defined variables or not.
Or subset of inherited variables
Job
Jobs are the most fundamental element of a .gitlab-ci.yml file.
Initializer
import { gitlab } from 'projen'
const job: gitlab.Job = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | No description. |
| | Whether to allow the pipeline to continue running on job failure (Default: false). |
| | No description. |
| string[] | No description. |
| | No description. |
| string | Must be a regular expression, optionally but recommended to be quoted, and must be surrounded with '/'. |
| string[] | Specify a list of job names from earlier stages from which artifacts should be loaded. |
| | Used to associate environment metadata with a deploy. |
| | Job will run except for when these filtering options match. |
| string[] | The name of one or more jobs to inherit configuration from. |
| | No description. |
| | Configurable ID tokens (JSON Web Tokens) that are used for CI/CD authentication. |
| | No description. |
| | Controls inheritance of globally-defined defaults and variables. |
| boolean | No description. |
| | The list of jobs in previous stages whose sole completion is needed to start the current job. |
| | Job will run only when these filtering options match. |
| | Parallel will split up a single job into several, and provide CI_NODE_INDEX and CI_NODE_TOTAL environment variables for the running jobs. |
| | Indicates that the job creates a Release. |
| string | Limit job concurrency. |
| | No description. |
| | Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job. |
| string[] | Shell scripts executed by the Runner. |
| | CI/CD secrets. |
| | No description. |
| string | Define what stage the job will run in. |
| string | No description. |
| string[] | No description. |
| string | No description. |
| | Trigger allows you to define downstream pipeline trigger. |
| {[ key: string ]: string} | Configurable values that are passed to the Job. |
| | Describes the conditions for when to run the job. |
afterScriptOptional
public readonly afterScript: string[];
- Type: string[]
allowFailureOptional
public readonly allowFailure: boolean | AllowFailure;
- Type: boolean | AllowFailure
Whether to allow the pipeline to continue running on job failure (Default: false).
artifactsOptional
public readonly artifacts: Artifacts;
- Type: Artifacts
beforeScriptOptional
public readonly beforeScript: string[];
- Type: string[]
cacheOptional
public readonly cache: Cache[];
- Type: Cache[]
coverageOptional
public readonly coverage: string;
- Type: string
Must be a regular expression, optionally but recommended to be quoted, and must be surrounded with '/'.
Example: '/Code coverage: \d+.\d+/'
dependenciesOptional
public readonly dependencies: string[];
- Type: string[]
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.
environmentOptional
public readonly environment: string | Environment;
- Type: string | 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.
exceptOptional
public readonly except: string[] | Filter;
- Type: string[] | Filter
Job will run except for when these filtering options match.
extendsOptional
public readonly extends: string[];
- Type: string[]
The name of one or more jobs to inherit configuration from.
hooksOptional
public readonly hooks: DefaultHooks;
- Type: DefaultHooks
idTokensOptional
public readonly idTokens: {[ key: string ]: IDToken};
- Type: {[ key: string ]: IDToken}
Configurable ID tokens (JSON Web Tokens) that are used for CI/CD authentication.
imageOptional
public readonly image: Image;
- Type: Image
inheritOptional
public readonly inherit: Inherit;
- Type: 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.
interruptibleOptional
public readonly interruptible: boolean;
- Type: boolean
needsOptional
public readonly needs: (string | Need)[];
- Type: string | Need[]
The list of jobs in previous stages whose sole completion is needed to start the current job.
onlyOptional
public readonly only: string[] | Filter;
- Type: string[] | Filter
Job will run only when these filtering options match.
parallelOptional
public readonly parallel: number | Parallel;
- Type: number | 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.
releaseOptional
public readonly release: Release;
- Type: Release
Indicates that the job creates a Release.
resourceGroupOptional
public readonly resourceGroup: string;
- Type: string
Limit job concurrency.
Can be used to ensure that the Runner will not run certain jobs simultaneously.
retryOptional
public readonly retry: Retry;
- Type: Retry
rulesOptional
public readonly rules: IncludeRule[];
- Type: IncludeRule[]
Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
scriptOptional
public readonly script: string[];
- Type: string[]
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.
secretsOptional
public readonly secrets: {[ key: string ]: {[ key: string ]: Secret}};
- Type: {[ key: string ]: {[ key: string ]: Secret}}
CI/CD secrets.
servicesOptional
public readonly services: Service[];
- Type: Service[]
stageOptional
public readonly stage: string;
- Type: string
Define what stage the job will run in.
startInOptional
public readonly startIn: string;
- Type: string
tagsOptional
public readonly tags: string[];
- Type: string[]
timeoutOptional
public readonly timeout: string;
- Type: string
triggerOptional
public readonly trigger: string | Trigger;
- Type: string | 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
variablesOptional
public readonly variables: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Configurable values that are passed to the Job.
whenOptional
public readonly when: JobWhen;
- Type: JobWhen
Describes the conditions for when to run the job.
Defaults to 'on_success'.
KubernetesConfig
Used to configure the kubernetes deployment for this environment.
This is currently not supported for kubernetes clusters that are managed by Gitlab.
Initializer
import { gitlab } from 'projen'
const kubernetesConfig: gitlab.KubernetesConfig = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The kubernetes namespace where this environment should be deployed to. |
namespaceOptional
public readonly namespace: string;
- Type: string
The kubernetes namespace where this environment should be deployed to.
Link
Link configuration for an asset.
Initializer
import { gitlab } from 'projen'
const link: gitlab.Link = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The name of the link. |
| string | The URL to download a file. |
| string | The redirect link to the url. |
| | The content kind of what users can download via url. |
nameRequired
public readonly name: string;
- Type: string
The name of the link.
urlRequired
public readonly url: string;
- Type: string
The URL to download a file.
filepathOptional
public readonly filepath: string;
- Type: string
The redirect link to the url.
linkTypeOptional
public readonly linkType: LinkType;
- Type: LinkType
The content kind of what users can download via url.
Need
A jobs in a previous stage whose sole completion is needed to start the current job.
Initializer
import { gitlab } from 'projen'
const need: gitlab.Need = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | No description. |
| boolean | No description. |
| boolean | No description. |
| string | No description. |
| string | No description. |
| string | No description. |
jobRequired
public readonly job: string;
- Type: string
artifactsOptional
public readonly artifacts: boolean;
- Type: boolean
optionalOptional
public readonly optional: boolean;
- Type: boolean
pipelineOptional
public readonly pipeline: string;
- Type: string
projectOptional
public readonly project: string;
- Type: string
refOptional
public readonly ref: string;
- Type: string
Parallel
Used to run a job multiple times in parallel in a single pipeline.
Initializer
import { gitlab } from 'projen'
const parallel: gitlab.Parallel = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| {[ key: string ]: any[]}[] | Defines different variables for jobs that are running in parallel. |
matrixRequired
public readonly matrix: {[ key: string ]: any[]}[];
- Type: {[ key: string ]: any[]}[]
Defines different variables for jobs that are running in parallel.
Release
Indicates that the job creates a Release.
Initializer
import { gitlab } from 'projen'
const release: gitlab.Release = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Specifies the longer description of the Release. |
| string | The tag_name must be specified. |
| | No description. |
| string[] | The title of each milestone the release is associated with. |
| string | The Release name. |
| string | If the release: tag_name doesn’t exist yet, the release is created from ref. |
| string | The date and time when the release is ready. |
descriptionRequired
public readonly description: string;
- Type: string
Specifies the longer description of the Release.
tagNameRequired
public readonly tagName: string;
- Type: string
The tag_name must be specified.
It can refer to an existing Git tag or can be specified by the user.
assetsOptional
public readonly assets: Assets;
- Type: Assets
milestonesOptional
public readonly milestones: string[];
- Type: string[]
The title of each milestone the release is associated with.
nameOptional
public readonly name: string;
- Type: string
The Release name.
If omitted, it is populated with the value of release: tag_name.
refOptional
public readonly ref: string;
- Type: string
If the release: tag_name doesn’t exist yet, the release is created from ref.
ref can be a commit SHA, another tag name, or a branch name.
releasedAtOptional
public readonly releasedAt: string;
- Type: string
The date and time when the release is ready.
Defaults to the current date and time if not defined. Should be enclosed in quotes and expressed in ISO 8601 format.
Reports
Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests.
Initializer
import { gitlab } from 'projen'
const reports: gitlab.Reports = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Path for file(s) that should be parsed as Cobertura XML coverage report. |
| string[] | Path to file or list of files with code quality report(s) (such as Code Climate). |
| string[] | Path to file or list of files with Container scanning vulnerabilities report(s). |
| | Code coverage report information. |
| string[] | Path to file or list of files with DAST vulnerabilities report(s). |
| string[] | Path to file or list of files with Dependency scanning vulnerabilities report(s). |
| string[] | Path to file or list of files containing runtime-created variables for this job. |
| string[] | Path for file(s) that should be parsed as JUnit XML result. |
| string[] | Deprecated in 12.8: Path to file or list of files with license report(s). |
| string[] | Path to file or list of files with license report(s). |
| string[] | Path to file or list of files containing code intelligence (Language Server Index Format). |
| string[] | Path to file or list of files with custom metrics report(s). |
| string[] | Path to file or list of files with performance metrics report(s). |
| string[] | Path to file or list of files with requirements report(s). |
| string[] | Path to file or list of files with SAST vulnerabilities report(s). |
| string[] | Path to file or list of files with secret detection report(s). |
| string[] | Path to file or list of files with terraform plan(s). |
coberturaOptional
cobertura- Deprecated: per {@link https://docs.gitlab.com/ee/update/deprecations.html#artifactsreportscobertura-keyword} use {@link coverageReport } instead
public readonly cobertura: string[];
- Type: string[]
Path for file(s) that should be parsed as Cobertura XML coverage report.
codequalityOptional
public readonly codequality: string[];
- Type: string[]
Path to file or list of files with code quality report(s) (such as Code Climate).
containerScanningOptional
public readonly containerScanning: string[];
- Type: string[]
Path to file or list of files with Container scanning vulnerabilities report(s).
coverageReportOptional
public readonly coverageReport: CoverageReport;
- Type: CoverageReport
Code coverage report information.
dastOptional
public readonly dast: string[];
- Type: string[]
Path to file or list of files with DAST vulnerabilities report(s).
dependencyScanningOptional
public readonly dependencyScanning: string[];
- Type: string[]
Path to file or list of files with Dependency scanning vulnerabilities report(s).
dotenvOptional
public readonly dotenv: string[];
- Type: string[]
Path to file or list of files containing runtime-created variables for this job.
junitOptional
public readonly junit: string[];
- Type: string[]
Path for file(s) that should be parsed as JUnit XML result.
licenseManagementOptional
public readonly licenseManagement: string[];
- Type: string[]
Deprecated in 12.8: Path to file or list of files with license report(s).
licenseScanningOptional
public readonly licenseScanning: string[];
- Type: string[]
Path to file or list of files with license report(s).
lsifOptional
public readonly lsif: string[];
- Type: string[]
Path to file or list of files containing code intelligence (Language Server Index Format).
metricsOptional
public readonly metrics: string[];
- Type: string[]
Path to file or list of files with custom metrics report(s).
performanceOptional
public readonly performance: string[];
- Type: string[]
Path to file or list of files with performance metrics report(s).
requirementsOptional
public readonly requirements: string[];
- Type: string[]
Path to file or list of files with requirements report(s).
sastOptional
public readonly sast: string[];
- Type: string[]
Path to file or list of files with SAST vulnerabilities report(s).
secretDetectionOptional
public readonly secretDetection: string[];
- Type: string[]
Path to file or list of files with secret detection report(s).
terraformOptional
public readonly terraform: string[];
- Type: string[]
Path to file or list of files with terraform plan(s).
Retry
How many times a job is retried if it fails.
If not defined, defaults to 0 and jobs do not retry.
Initializer
import { gitlab } from 'projen'
const retry: gitlab.Retry = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| number | 0 (default), 1, or 2. |
| any | Either a single or array of error types to trigger job retry. |
maxOptional
public readonly max: number;
- Type: number
0 (default), 1, or 2.
whenOptional
public readonly when: any;
- Type: any
Either a single or array of error types to trigger job retry.
Secret
A CI/CD secret.
Initializer
import { gitlab } from 'projen'
const secret: gitlab.Secret = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| | No description. |
vaultRequired
public readonly vault: VaultConfig;
- Type: VaultConfig
Service
Used to specify an additional Docker image to run scripts in.
The service image is linked to the image specified in the
Initializer
import { gitlab } from 'projen'
const service: gitlab.Service = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Full name of the image that should be used. |
| string | Additional alias that can be used to access the service from the job's container. |
| string[] | Command or script that should be used as the container's command. |
| string[] | Command or script that should be executed as the container's entrypoint. |
| | The pull policy that the runner uses to fetch the Docker image. |
| {[ key: string ]: string} | Additional environment variables that are passed exclusively to the service.. |
nameRequired
public readonly name: string;
- Type: string
Full name of the image that should be used.
It should contain the Registry part if needed.
aliasOptional
public readonly alias: string;
- Type: string
Additional alias that can be used to access the service from the job's container.
Read Accessing the services for more information.
commandOptional
public readonly command: string[];
- Type: string[]
Command or script that should be used as the container's command.
It will be translated to arguments passed to Docker after the image's name. The syntax is similar to Dockerfile's CMD directive, where each shell token is a separate string in the array.
entrypointOptional
public readonly entrypoint: string[];
- Type: string[]
Command or script that should be executed as the container's entrypoint.
It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array.
pullPolicyOptional
public readonly pullPolicy: PullPolicy[];
- Type: PullPolicy[]
The pull policy that the runner uses to fetch the Docker image.
variablesOptional
public readonly variables: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Additional environment variables that are passed exclusively to the service..
Trigger
Trigger a multi-project or a child pipeline.
Read more:
https://docs.gitlab.com/ee/ci/yaml/README.html#trigger-syntax-for-child-pipeline
Initializer
import { gitlab } from 'projen'
const trigger: gitlab.Trigger = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The branch name that a downstream pipeline will use. |
| | A list of local files or artifacts from other jobs to define the pipeline. |
| string | Path to the project, e.g. group/project, or group/sub-group/project. |
| | You can mirror the pipeline status from the triggered pipeline to the source bridge job by using strategy: depend. |
branchOptional
public readonly branch: string;
- Type: string
The branch name that a downstream pipeline will use.
includeOptional
public readonly include: TriggerInclude[];
- Type: TriggerInclude[]
A list of local files or artifacts from other jobs to define the pipeline.
projectOptional
public readonly project: string;
- Type: string
Path to the project, e.g. group/project, or group/sub-group/project.
strategyOptional
public readonly strategy: Strategy;
- Type: Strategy
You can mirror the pipeline status from the triggered pipeline to the source bridge job by using strategy: depend.
TriggerInclude
References a local file or an artifact from another job to define the pipeline configuration.
Initializer
import { gitlab } from 'projen'
const triggerInclude: gitlab.TriggerInclude = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Relative path to the generated YAML file which is extracted from the artifacts and used as the configuration for triggering the child pipeline. |
| string | Relative path from repository root (/) to the pipeline configuration YAML file. |
| string | Job name which generates the artifact. |
| string | Relative path from local repository root (/) to the local YAML file to define the pipeline configuration. |
| string | Path to another private project under the same GitLab instance, like group/project or group/sub-group/project. |
| string | Branch/Tag/Commit hash for the target project. |
| string | Name of the template YAML file to use in the pipeline configuration. |
artifactOptional
public readonly artifact: string;
- Type: string
Relative path to the generated YAML file which is extracted from the artifacts and used as the configuration for triggering the child pipeline.
fileOptional
public readonly file: string;
- Type: string
Relative path from repository root (/) to the pipeline configuration YAML file.
jobOptional
public readonly job: string;
- Type: string
Job name which generates the artifact.
localOptional
public readonly local: string;
- Type: string
Relative path from local repository root (/) to the local YAML file to define the pipeline configuration.
projectOptional
public readonly project: string;
- Type: string
Path to another private project under the same GitLab instance, like group/project or group/sub-group/project.
refOptional
public readonly ref: string;
- Type: string
Branch/Tag/Commit hash for the target project.
templateOptional
public readonly template: string;
- Type: string
Name of the template YAML file to use in the pipeline configuration.
VariableConfig
Explains what the global variable is used for, what the acceptable values are.
Initializer
import { gitlab } from 'projen'
const variableConfig: gitlab.VariableConfig = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Define a global variable that is prefilled when running a pipeline manually. |
| string | The variable value. |
descriptionOptional
public readonly description: string;
- Type: string
Define a global variable that is prefilled when running a pipeline manually.
Must be used with value.
valueOptional
public readonly value: string;
- Type: string
The variable value.
VaultConfig
Specification for a secret provided by a HashiCorp Vault.
Initializer
import { gitlab } from 'projen'
const vaultConfig: gitlab.VaultConfig = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| | No description. |
| string | No description. |
| string | Path to the secret. |
engineRequired
public readonly engine: Engine;
- Type: Engine
fieldRequired
public readonly field: string;
- Type: string
pathRequired
public readonly path: string;
- Type: string
Path to the secret.
Workflow
Used to control pipeline behavior.
Initializer
import { gitlab } from 'projen'
const workflow: gitlab.Workflow = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | You can use name to define a name for pipelines. |
| | Used to control whether or not a whole pipeline is created. |
nameOptional
public readonly name: string;
- Type: string
You can use name to define a name for pipelines.
rulesOptional
public readonly rules: WorkflowRule[];
- Type: WorkflowRule[]
Used to control whether or not a whole pipeline is created.
WorkflowRule
Used to control whether or not a whole pipeline is created.
Initializer
import { gitlab } from 'projen'
const workflowRule: gitlab.WorkflowRule = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | No description. |
| string[] | No description. |
| string | No description. |
| {[ key: string ]: string | number} | No description. |
| | No description. |
changesOptional
public readonly changes: string[];
- Type: string[]
existsOptional
public readonly exists: string[];
- Type: string[]
ifOptional
public readonly if: string;
- Type: string
variablesOptional
public readonly variables: {[ key: string ]: string | number};
- Type: {[ key: string ]: string | number}
whenOptional
public readonly when: WorkflowWhen;
- Type: WorkflowWhen
Protocols
IDToken
- Implemented By: IDToken
id_tokens Definition.
Properties
| Name | Type | Description |
|---|---|---|
| string | string[] | The required aud sub-keyword is used to configure the aud claim for the JWT. |
audRequired
public readonly aud: string | string[];
- Type: string | string[]
The required aud sub-keyword is used to configure the aud claim for the JWT.
Enums
Action
Specifies what this job will do.
'start' (default) indicates the job will start the deployment. 'prepare' indicates this will not affect the deployment. 'stop' indicates this will stop the deployment.
Members
| Name | Description |
|---|---|
| No description. |
| No description. |
| No description. |
PREPARE
START
STOP
CachePolicy
Configure the upload and download behaviour of a cache.
Members
| Name | Description |
|---|---|
| Only download the cache when the job starts, but never upload changes when the job finishes. |
| Only upload a cache when the job finishes, but never download the cache when the job starts. |
| The job downloads the cache when the job starts, and uploads changes to the cache when the job ends. |
PULL
Only download the cache when the job starts, but never upload changes when the job finishes.
PUSH
Only upload a cache when the job finishes, but never download the cache when the job starts.
PULL_PUSH
The job downloads the cache when the job starts, and uploads changes to the cache when the job ends.
CacheWhen
Configure when artifacts are uploaded depended on job status.
Members
| Name | Description |
|---|---|
| Upload artifacts regardless of job status. |
| Upload artifacts only when the job fails. |
| Upload artifacts only when the job succeeds (this is the default). |
ALWAYS
Upload artifacts regardless of job status.
ON_FAILURE
Upload artifacts only when the job fails.
ON_SUCCESS
Upload artifacts only when the job succeeds (this is the default).
DefaultElement
Members
| Name | Description |
|---|---|
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
AFTER_SCRIPT
ARTIFACTS
BEFORE_SCRIPT
CACHE
IMAGE
INTERRUPTIBLE
RETRY
SERVICES
TAGS
TIMEOUT
DeploymentTier
Explicitly specifies the tier of the deployment environment if non-standard environment name is used.
Members
| Name | Description |
|---|---|
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
DEVELOPMENT
OTHER
PRODUCTION
STAGING
TESTING
JobWhen
Describes the conditions for when to run the job.
Defaults to 'on_success'.
Members
| Name | Description |
|---|---|
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
| No description. |
ALWAYS
DELAYED
MANUAL
NEVER
ON_FAILURE
ON_SUCCESS
KubernetesEnum
Filter job based on if Kubernetes integration is active.
Members
| Name | Description |
|---|---|
| No description. |
ACTIVE
LinkType
The content kind of what users can download via url.
Members
| Name | Description |
|---|---|
| No description. |
| No description. |
| No description. |
| No description. |
IMAGE
OTHER
PACKAGE
RUNBOOK
PullPolicy
Describes the conditions for when to pull an image.
Members
| Name | Description |
|---|---|
| No description. |
| No description. |
| No description. |
ALWAYS
NEVER
IF_NOT_PRESENT
Strategy
You can mirror the pipeline status from the triggered pipeline to the source bridge job by using strategy: depend.
Members
| Name | Description |
|---|---|
| No description. |
DEPEND
WorkflowWhen
Describes the conditions for when to run the job.
Defaults to 'on_success'. The value can only be 'always' or 'never' when used with workflow.
Members
| Name | Description |
|---|---|
| No description. |
| No description. |