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. |
project
Required
- Type: projen.Project
name
Required
- Type: string
options
Optional
- 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. |
| 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.
caches
Required
- Type: Cache[]
Caches to add.
addGlobalVariables
public addGlobalVariables(variables: {[ key: string ]: any}): void
Add a globally defined variable to the CI configuration.
variables
Required
- Type: {[ key: string ]: any}
The variables to add.
addIncludes
public addIncludes(includes: ...Include[]): void
Add additional yml/yaml files to the CI includes.
includes
Required
- Type: ...Include[]
The includes to add.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Add jobs and their stages to the CI configuration.
jobs
Required
- Type: {[ key: string ]: Job}
Jobs to add.
addServices
public addServices(services: ...Service[]): void
Add additional services.
services
Required
- Type: ...Service[]
The services to add.
addStages
public addStages(stages: ...string[]): void
Add stages to the CI configuration if not already present.
stages
Required
- 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.
x
Required
- Type: any
Any object.
isComponent
import { gitlab } from 'projen'
gitlab.CiConfiguration.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- 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. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
defaultAfterScript
Required
public readonly defaultAfterScript: string[];
- Type: string[]
Defines default scripts that should run after all jobs.
Can be overriden by the job level afterScript
.
defaultBeforeScript
Required
public readonly defaultBeforeScript: string[];
- Type: string[]
Defines default scripts that should run before all jobs.
Can be overriden by the job level afterScript
.
defaultTags
Required
public readonly defaultTags: string[];
- Type: string[]
Used to select a specific runner from the list of all runners that are available for the project.
file
Required
public readonly file: YamlFile;
- Type: projen.YamlFile
The workflow YAML file.
jobs
Required
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
The jobs in the CI configuration.
name
Required
public readonly name: string;
- Type: string
The name of the configuration.
path
Required
public readonly path: string;
- Type: string
Path to CI file generated by the configuration.
stages
Required
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'].
variables
Required
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.
defaultArtifacts
Optional
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.
defaultCache
Optional
public readonly defaultCache: Cache[];
- Type: Cache[]
defaultIdTokens
Optional
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.
defaultImage
Optional
public readonly defaultImage: Image;
- Type: Image
Specifies the default docker image to use globally for all jobs.
defaultInterruptible
Optional
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).
defaultRetry
Optional
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.
defaultTimeout
Optional
public readonly defaultTimeout: string;
- Type: string
A default timeout job written in natural language (Ex.
one hour, 3600 seconds, 60 minutes).
pages
Optional
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.
workflow
Optional
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. |
project
Required
- Type: projen.Project
options
Optional
- 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. |
| 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.
caches
Required
- Type: Cache[]
Caches to add.
addGlobalVariables
public addGlobalVariables(variables: {[ key: string ]: any}): void
Add a globally defined variable to the CI configuration.
variables
Required
- Type: {[ key: string ]: any}
The variables to add.
addIncludes
public addIncludes(includes: ...Include[]): void
Add additional yml/yaml files to the CI includes.
includes
Required
- Type: ...Include[]
The includes to add.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Add jobs and their stages to the CI configuration.
jobs
Required
- Type: {[ key: string ]: Job}
Jobs to add.
addServices
public addServices(services: ...Service[]): void
Add additional services.
services
Required
- Type: ...Service[]
The services to add.
addStages
public addStages(stages: ...string[]): void
Add stages to the CI configuration if not already present.
stages
Required
- 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')
config
Required
- 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.
x
Required
- Type: any
Any object.
isComponent
import { gitlab } from 'projen'
gitlab.GitlabConfiguration.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- 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. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
defaultAfterScript
Required
public readonly defaultAfterScript: string[];
- Type: string[]
Defines default scripts that should run after all jobs.
Can be overriden by the job level afterScript
.
defaultBeforeScript
Required
public readonly defaultBeforeScript: string[];
- Type: string[]
Defines default scripts that should run before all jobs.
Can be overriden by the job level afterScript
.
defaultTags
Required
public readonly defaultTags: string[];
- Type: string[]
Used to select a specific runner from the list of all runners that are available for the project.
file
Required
public readonly file: YamlFile;
- Type: projen.YamlFile
The workflow YAML file.
jobs
Required
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
The jobs in the CI configuration.
name
Required
public readonly name: string;
- Type: string
The name of the configuration.
path
Required
public readonly path: string;
- Type: string
Path to CI file generated by the configuration.
stages
Required
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'].
variables
Required
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.
defaultArtifacts
Optional
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.
defaultCache
Optional
public readonly defaultCache: Cache[];
- Type: Cache[]
defaultIdTokens
Optional
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.
defaultImage
Optional
public readonly defaultImage: Image;
- Type: Image
Specifies the default docker image to use globally for all jobs.
defaultInterruptible
Optional
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).
defaultRetry
Optional
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.
defaultTimeout
Optional
public readonly defaultTimeout: string;
- Type: string
A default timeout job written in natural language (Ex.
one hour, 3600 seconds, 60 minutes).
pages
Optional
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.
workflow
Optional
public readonly workflow: Workflow;
- Type: Workflow
Used to control pipeline behavior.
nestedTemplates
Required
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. |
project
Required
- Type: projen.Project
parent
Required
- Type: GitlabConfiguration
name
Required
- Type: string
The name of the configuration.
options
Optional
- 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. |
| 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.
caches
Required
- Type: Cache[]
Caches to add.
addGlobalVariables
public addGlobalVariables(variables: {[ key: string ]: any}): void
Add a globally defined variable to the CI configuration.
variables
Required
- Type: {[ key: string ]: any}
The variables to add.
addIncludes
public addIncludes(includes: ...Include[]): void
Add additional yml/yaml files to the CI includes.
includes
Required
- Type: ...Include[]
The includes to add.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Add jobs and their stages to the CI configuration.
jobs
Required
- Type: {[ key: string ]: Job}
Jobs to add.
addServices
public addServices(services: ...Service[]): void
Add additional services.
services
Required
- Type: ...Service[]
The services to add.
addStages
public addStages(stages: ...string[]): void
Add stages to the CI configuration if not already present.
stages
Required
- 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.
x
Required
- Type: any
Any object.
isComponent
import { gitlab } from 'projen'
gitlab.NestedConfiguration.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- 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. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
defaultAfterScript
Required
public readonly defaultAfterScript: string[];
- Type: string[]
Defines default scripts that should run after all jobs.
Can be overriden by the job level afterScript
.
defaultBeforeScript
Required
public readonly defaultBeforeScript: string[];
- Type: string[]
Defines default scripts that should run before all jobs.
Can be overriden by the job level afterScript
.
defaultTags
Required
public readonly defaultTags: string[];
- Type: string[]
Used to select a specific runner from the list of all runners that are available for the project.
file
Required
public readonly file: YamlFile;
- Type: projen.YamlFile
The workflow YAML file.
jobs
Required
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
The jobs in the CI configuration.
name
Required
public readonly name: string;
- Type: string
The name of the configuration.
path
Required
public readonly path: string;
- Type: string
Path to CI file generated by the configuration.
stages
Required
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'].
variables
Required
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.
defaultArtifacts
Optional
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.
defaultCache
Optional
public readonly defaultCache: Cache[];
- Type: Cache[]
defaultIdTokens
Optional
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.
defaultImage
Optional
public readonly defaultImage: Image;
- Type: Image
Specifies the default docker image to use globally for all jobs.
defaultInterruptible
Optional
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).
defaultRetry
Optional
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.
defaultTimeout
Optional
public readonly defaultTimeout: string;
- Type: string
A default timeout job written in natural language (Ex.
one hour, 3600 seconds, 60 minutes).
pages
Optional
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.
workflow
Optional
public readonly workflow: Workflow;
- Type: Workflow
Used to control pipeline behavior.
parent
Required
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. |
exitCodes
Required
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. |
exclude
Optional
public readonly exclude: string[];
- Type: string[]
A list of paths to files/folders that should be excluded in the artifact.
expireIn
Optional
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'.
exposeAs
Optional
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.
name
Optional
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'
paths
Optional
public readonly paths: string[];
- Type: string[]
A list of paths to files/folders that should be included in the artifact.
reports
Optional
public readonly reports: Reports;
- Type: Reports
Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests.
untracked
Optional
public readonly untracked: boolean;
- Type: boolean
Whether to add all untracked files (along with 'artifacts.paths') to the artifact.
when
Optional
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. |
links
Required
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). |
fallbackKeys
Optional
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.
key
Optional
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.
paths
Optional
public readonly paths: string[];
- Type: string[]
Defines which files or directories to cache.
policy
Optional
public readonly policy: CachePolicy;
- Type: CachePolicy
Defines the upload and download behaviour of the cache.
untracked
Optional
public readonly untracked: boolean;
- Type: boolean
If set to true all files that are untracked in your Git repository will be cached.
when
Optional
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. |
files
Required
public readonly files: string[];
- Type: string[]
The files that are checked against.
If the SHA checksum changes, the cache becomes invalid.
prefix
Optional
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. |
default
Optional
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.
jobs
Optional
public readonly jobs: {[ key: string ]: Job};
- Type: {[ key: string ]: Job}
An initial set of jobs to add to the configuration.
pages
Optional
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.
path
Optional
public readonly path: string;
- Type: string
The path of the file to generate.
stages
Optional
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'].
variables
Optional
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.
workflow
Optional
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. |
coverageFormat
Required
public readonly coverageFormat: string;
- Type: string
path
Required
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. |
|
| 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. |
afterScript
Optional
public readonly afterScript: string[];
- Type: string[]
artifacts
Optional
public readonly artifacts: Artifacts;
- Type: Artifacts
beforeScript
Optional
public readonly beforeScript: string[];
- Type: string[]
cache
Optional
public readonly cache: Cache[];
- Type: Cache[]
idTokens
Optional
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.
image
Optional
public readonly image: Image;
- Type: Image
interruptible
Optional
public readonly interruptible: boolean;
- Type: boolean
retry
Optional
public readonly retry: Retry;
- Type: Retry
services
Optional
public readonly services: Service[];
- Type: Service[]
tags
Optional
public readonly tags: string[];
- Type: string[]
timeout
Optional
public readonly timeout: string;
- Type: string
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. |
name
Required
public readonly name: string;
- Type: string
Name of the secrets engine.
path
Required
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. |
name
Required
public readonly name: string;
- Type: string
The name of the environment, e.g. 'qa', 'staging', 'production'.
action
Optional
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.
autoStopIn
Optional
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'.
deploymentTier
Optional
public readonly deploymentTier: DeploymentTier;
- Type: DeploymentTier
Explicitly specifies the tier of the deployment environment if non-standard environment name is used.
kubernetes
Optional
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.
onStop
Optional
public readonly onStop: string;
- Type: string
The name of a job to execute when the environment is about to be stopped.
url
Optional
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. |
changes
Optional
public readonly changes: string[];
- Type: string[]
Filter job creation based on files that were modified in a git push.
kubernetes
Optional
public readonly kubernetes: KubernetesEnum;
- Type: KubernetesEnum
Filter job based on if Kubernetes integration is active.
refs
Optional
public readonly refs: string[];
- Type: string[]
Control when to add jobs to a pipeline based on branch names or pipeline types.
variables
Optional
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. |
name
Required
public readonly name: string;
- Type: string
Full name of the image that should be used.
It should contain the Registry part if needed.
entrypoint
Optional
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 . |
file
Optional
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.
local
Optional
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.
project
Optional
public readonly project: string;
- Type: string
Path to the project, e.g. group/project
, or group/sub-group/project
.
ref
Optional
public readonly ref: string;
- Type: string
Branch/Tag/Commit-hash for the target project.
remote
Optional
public readonly remote: string;
- Type: string
URL to a yaml
/yml
template file using HTTP/HTTPS.
rules
Optional
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.
template
Optional
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. |
allowFailure
Optional
public readonly allowFailure: boolean | AllowFailure;
- Type: boolean | AllowFailure
changes
Optional
public readonly changes: string[];
- Type: string[]
exists
Optional
public readonly exists: string[];
- Type: string[]
if
Optional
public readonly if: string;
- Type: string
needs
Optional
public readonly needs: string[];
- Type: string[]
startIn
Optional
public readonly startIn: string;
- Type: string
variables
Optional
public readonly variables: {[ key: string ]: string};
- Type: {[ key: string ]: string}
when
Optional
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. |
default
Optional
public readonly default: boolean | DefaultElement[];
- Type: boolean | DefaultElement[]
Whether to inherit all globally-defined defaults or not.
Or subset of inherited defaults
variables
Optional
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. |
|
| 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. |
afterScript
Optional
public readonly afterScript: string[];
- Type: string[]
allowFailure
Optional
public readonly allowFailure: boolean | AllowFailure;
- Type: boolean | AllowFailure
Whether to allow the pipeline to continue running on job failure (Default: false).
artifacts
Optional
public readonly artifacts: Artifacts;
- Type: Artifacts
beforeScript
Optional
public readonly beforeScript: string[];
- Type: string[]
cache
Optional
public readonly cache: Cache[];
- Type: Cache[]
coverage
Optional
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+/'
dependencies
Optional
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.
environment
Optional
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.
except
Optional
public readonly except: string[] | Filter;
- Type: string[] | Filter
Job will run except for when these filtering options match.
extends
Optional
public readonly extends: string[];
- Type: string[]
The name of one or more jobs to inherit configuration from.
idTokens
Optional
public readonly idTokens: {[ key: string ]: IDToken};
- Type: {[ key: string ]: IDToken}
Configurable ID tokens (JSON Web Tokens) that are used for CI/CD authentication.
image
Optional
public readonly image: Image;
- Type: Image
inherit
Optional
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.
interruptible
Optional
public readonly interruptible: boolean;
- Type: boolean
needs
Optional
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.
only
Optional
public readonly only: string[] | Filter;
- Type: string[] | Filter
Job will run only when these filtering options match.
parallel
Optional
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.
release
Optional
public readonly release: Release;
- Type: Release
Indicates that the job creates a Release.
resourceGroup
Optional
public readonly resourceGroup: string;
- Type: string
Limit job concurrency.
Can be used to ensure that the Runner will not run certain jobs simultaneously.
retry
Optional
public readonly retry: Retry;
- Type: Retry
rules
Optional
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.
script
Optional
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.
secrets
Optional
public readonly secrets: {[ key: string ]: {[ key: string ]: Secret}};
- Type: {[ key: string ]: {[ key: string ]: Secret}}
CI/CD secrets.
services
Optional
public readonly services: Service[];
- Type: Service[]
stage
Optional
public readonly stage: string;
- Type: string
Define what stage the job will run in.
startIn
Optional
public readonly startIn: string;
- Type: string
tags
Optional
public readonly tags: string[];
- Type: string[]
timeout
Optional
public readonly timeout: string;
- Type: string
trigger
Optional
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
variables
Optional
public readonly variables: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Configurable values that are passed to the Job.
when
Optional
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. |
namespace
Optional
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. |
name
Required
public readonly name: string;
- Type: string
The name of the link.
url
Required
public readonly url: string;
- Type: string
The URL to download a file.
filepath
Optional
public readonly filepath: string;
- Type: string
The redirect link to the url.
linkType
Optional
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. |
job
Required
public readonly job: string;
- Type: string
artifacts
Optional
public readonly artifacts: boolean;
- Type: boolean
optional
Optional
public readonly optional: boolean;
- Type: boolean
pipeline
Optional
public readonly pipeline: string;
- Type: string
project
Optional
public readonly project: string;
- Type: string
ref
Optional
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. |
matrix
Required
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. |
description
Required
public readonly description: string;
- Type: string
Specifies the longer description of the Release.
tagName
Required
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.
assets
Optional
public readonly assets: Assets;
- Type: Assets
milestones
Optional
public readonly milestones: string[];
- Type: string[]
The title of each milestone the release is associated with.
name
Optional
public readonly name: string;
- Type: string
The Release name.
If omitted, it is populated with the value of release: tag_name.
ref
Optional
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.
releasedAt
Optional
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). |
cobertura
Optional
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.
codequality
Optional
public readonly codequality: string[];
- Type: string[]
Path to file or list of files with code quality report(s) (such as Code Climate).
containerScanning
Optional
public readonly containerScanning: string[];
- Type: string[]
Path to file or list of files with Container scanning vulnerabilities report(s).
coverageReport
Optional
public readonly coverageReport: CoverageReport;
- Type: CoverageReport
Code coverage report information.
dast
Optional
public readonly dast: string[];
- Type: string[]
Path to file or list of files with DAST vulnerabilities report(s).
dependencyScanning
Optional
public readonly dependencyScanning: string[];
- Type: string[]
Path to file or list of files with Dependency scanning vulnerabilities report(s).
dotenv
Optional
public readonly dotenv: string[];
- Type: string[]
Path to file or list of files containing runtime-created variables for this job.
junit
Optional
public readonly junit: string[];
- Type: string[]
Path for file(s) that should be parsed as JUnit XML result.
licenseManagement
Optional
public readonly licenseManagement: string[];
- Type: string[]
Deprecated in 12.8: Path to file or list of files with license report(s).
licenseScanning
Optional
public readonly licenseScanning: string[];
- Type: string[]
Path to file or list of files with license report(s).
lsif
Optional
public readonly lsif: string[];
- Type: string[]
Path to file or list of files containing code intelligence (Language Server Index Format).
metrics
Optional
public readonly metrics: string[];
- Type: string[]
Path to file or list of files with custom metrics report(s).
performance
Optional
public readonly performance: string[];
- Type: string[]
Path to file or list of files with performance metrics report(s).
requirements
Optional
public readonly requirements: string[];
- Type: string[]
Path to file or list of files with requirements report(s).
sast
Optional
public readonly sast: string[];
- Type: string[]
Path to file or list of files with SAST vulnerabilities report(s).
secretDetection
Optional
public readonly secretDetection: string[];
- Type: string[]
Path to file or list of files with secret detection report(s).
terraform
Optional
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. |
max
Optional
public readonly max: number;
- Type: number
0 (default), 1, or 2.
when
Optional
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. |
vault
Required
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.. |
name
Required
public readonly name: string;
- Type: string
Full name of the image that should be used.
It should contain the Registry part if needed.
alias
Optional
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.
command
Optional
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.
entrypoint
Optional
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.
pullPolicy
Optional
public readonly pullPolicy: PullPolicy[];
- Type: PullPolicy[]
The pull policy that the runner uses to fetch the Docker image.
variables
Optional
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. |
branch
Optional
public readonly branch: string;
- Type: string
The branch name that a downstream pipeline will use.
include
Optional
public readonly include: TriggerInclude[];
- Type: TriggerInclude[]
A list of local files or artifacts from other jobs to define the pipeline.
project
Optional
public readonly project: string;
- Type: string
Path to the project, e.g. group/project
, or group/sub-group/project
.
strategy
Optional
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. |
artifact
Optional
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.
file
Optional
public readonly file: string;
- Type: string
Relative path from repository root (/
) to the pipeline configuration YAML file.
job
Optional
public readonly job: string;
- Type: string
Job name which generates the artifact.
local
Optional
public readonly local: string;
- Type: string
Relative path from local repository root (/
) to the local YAML file to define the pipeline configuration.
project
Optional
public readonly project: string;
- Type: string
Path to another private project under the same GitLab instance, like group/project
or group/sub-group/project
.
ref
Optional
public readonly ref: string;
- Type: string
Branch/Tag/Commit hash for the target project.
template
Optional
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. |
description
Optional
public readonly description: string;
- Type: string
Define a global variable that is prefilled when running a pipeline manually.
Must be used with value.
value
Optional
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. |
engine
Required
public readonly engine: Engine;
- Type: Engine
field
Required
public readonly field: string;
- Type: string
path
Required
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. |
name
Optional
public readonly name: string;
- Type: string
You can use name to define a name for pipelines.
rules
Optional
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. |
changes
Optional
public readonly changes: string[];
- Type: string[]
exists
Optional
public readonly exists: string[];
- Type: string[]
if
Optional
public readonly if: string;
- Type: string
variables
Optional
public readonly variables: {[ key: string ]: string | number};
- Type: {[ key: string ]: string | number}
when
Optional
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. |
aud
Required
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. |