Skip to content

API Reference

Structs

AddChildrenProps

Initializer

1
2
3
import { AddChildrenProps } from '@gcix/gcix'

const addChildrenProps: AddChildrenProps = { ... }

Properties

Name Type Description
jobsOrJobCollections Job | JobCollection[] No description.
name string No description.
stage string No description.

jobsOrJobCollectionsRequired
public readonly jobsOrJobCollections: Job | JobCollection[];

nameOptional
public readonly name: string;
  • Type: string

stageOptional
public readonly stage: string;
  • Type: string

ArtifactsProps

Initializer

1
2
3
import { ArtifactsProps } from '@gcix/gcix'

const artifactsProps: ArtifactsProps = { ... }

Properties

Name Type Description
excludes string[] Paths that prevent files from being added to an artifacts archive.
expireIn string How long the artifacts will be saved before it gets deleted.
exposeAs string Used to expose artifacts in merge requests.
name string Name of the artifacts archive.
paths string[] Paths relative to project directory $CI_PROJECT_DIR, found files will be used to create the artifacts.
public boolean True makes artifacts public.
reports ArtifactsReport[] Reports must be a valid dictionary, the key represents a ArtifactsReport and the value must be a valid relativ file path to the reports file.
untracked boolean If true adds all untracked file to artifacts archive.
when WhenStatement When to upload artifacts, Only on_success, on_failure or always is allowed.

excludesOptional
public readonly excludes: string[];
  • Type: string[]

Paths that prevent files from being added to an artifacts archive.


expireInOptional
public readonly expireIn: string;
  • Type: string

How long the artifacts will be saved before it gets deleted.


exposeAsOptional
public readonly exposeAs: string;
  • Type: string

Used to expose artifacts in merge requests.


nameOptional
public readonly name: string;
  • Type: string

Name of the artifacts archive.

Internally defaults to {PredefinedVariables.ciJobName}-{PredefinedVariables.ciCommitRefSlug}.


pathsOptional
public readonly paths: string[];
  • Type: string[]

Paths relative to project directory $CI_PROJECT_DIR, found files will be used to create the artifacts.


publicOptional
public readonly public: boolean;
  • Type: boolean

True makes artifacts public.


reportsOptional
public readonly reports: ArtifactsReport[];

Reports must be a valid dictionary, the key represents a ArtifactsReport and the value must be a valid relativ file path to the reports file.


untrackedOptional
public readonly untracked: boolean;
  • Type: boolean

If true adds all untracked file to artifacts archive.


whenOptional
public readonly when: WhenStatement;

When to upload artifacts, Only on_success, on_failure or always is allowed.


ArtifactsReport

Initializer

1
2
3
import { ArtifactsReport } from '@gcix/gcix'

const artifactsReport: ArtifactsReport = { ... }

Properties

Name Type Description
file string Relative path withing the project, where to find the generated report file.
reportType string https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html ArtifactsReport type to use.

fileRequired
public readonly file: string;
  • Type: string

Relative path withing the project, where to find the generated report file.


reportTypeRequired
public readonly reportType: string;
  • Type: string

https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html ArtifactsReport type to use.


CacheKeyProps

Initializer

1
2
3
import { CacheKeyProps } from '@gcix/gcix'

const cacheKeyProps: CacheKeyProps = { ... }

Properties

Name Type Description
files string[] No description.
key string No description.
prefix string No description.

filesOptional
public readonly files: string[];
  • Type: string[]

keyOptional
public readonly key: string;
  • Type: string
  • Default: gcix.PredefinedVariables.ciCommitRefSlug

prefixOptional
public readonly prefix: string;
  • Type: string

CacheProps

Initializer

1
2
3
import { CacheProps } from '@gcix/gcix'

const cacheProps: CacheProps = { ... }

Properties

Name Type Description
paths string[] No description.
cacheKey CacheKey No description.
policy CachePolicy No description.
untracked boolean Set the untracked keyword to True to cache all files that are untracked in your Git repository.
when WhenStatement No description.

pathsRequired
public readonly paths: string[];
  • Type: string[]

cacheKeyOptional
public readonly cacheKey: CacheKey;
  • Type: CacheKey
  • Default: to CacheKey with default arguments.

policyOptional
public readonly policy: CachePolicy;

untrackedOptional
public readonly untracked: boolean;
  • Type: boolean

Set the untracked keyword to True to cache all files that are untracked in your Git repository.


whenOptional
public readonly when: WhenStatement;

ChildDict

Initializer

1
2
3
import { ChildDict } from '@gcix/gcix'

const childDict: ChildDict = { ... }

Properties

Name Type Description
child Job | JobCollection No description.
name string No description.
stage string No description.

childRequired
public readonly child: Job | JobCollection;

nameOptional
public readonly name: string;
  • Type: string

stageOptional
public readonly stage: string;
  • Type: string

ImageProps

Initializer

1
2
3
import { ImageProps } from '@gcix/gcix'

const imageProps: ImageProps = { ... }

Properties

Name Type Description
name string No description.
entrypoint string[] No description.
tag string No description.

nameRequired
public readonly name: string;
  • Type: string

entrypointOptional
public readonly entrypoint: string[];
  • Type: string[]

tagOptional
public readonly tag: string;
  • Type: string

IncludeArtifactProps

Initializer

1
2
3
import { IncludeArtifactProps } from '@gcix/gcix'

const includeArtifactProps: IncludeArtifactProps = { ... }

Properties

Name Type Description
artifact string Relative path to the artifact which is produced by job.
job string Job name to include the artifact from.

artifactRequired
public readonly artifact: string;
  • Type: string

Relative path to the artifact which is produced by job.


jobRequired
public readonly job: string;
  • Type: string

Job name to include the artifact from.


IncludeFileProps

Initializer

1
2
3
import { IncludeFileProps } from '@gcix/gcix'

const includeFileProps: IncludeFileProps = { ... }

Properties

Name Type Description
file string Relative path to the file to include.
project string Project to include the file from.
ref string Project branch to include the file from.

fileRequired
public readonly file: string;
  • Type: string

Relative path to the file to include.


projectRequired
public readonly project: string;
  • Type: string

Project to include the file from.


refOptional
public readonly ref: string;
  • Type: string

Project branch to include the file from.


IncludeLocalProps

Initializer

1
2
3
import { IncludeLocalProps } from '@gcix/gcix'

const includeLocalProps: IncludeLocalProps = { ... }

Properties

Name Type Description
local string Relative path to the file within this repository to include.

localRequired
public readonly local: string;
  • Type: string

Relative path to the file within this repository to include.


IncludeRemoteProps

Initializer

1
2
3
import { IncludeRemoteProps } from '@gcix/gcix'

const includeRemoteProps: IncludeRemoteProps = { ... }

Properties

Name Type Description
remote string URL to include the file from.

remoteRequired
public readonly remote: string;
  • Type: string

URL to include the file from.


IncludeTemplateProps

Initializer

1
2
3
import { IncludeTemplateProps } from '@gcix/gcix'

const includeTemplateProps: IncludeTemplateProps = { ... }

Properties

Name Type Description
template string Gitlab template pipeline to include.

templateRequired
public readonly template: string;
  • Type: string

Gitlab template pipeline to include.


JobProps

Initializer

1
2
3
import { JobProps } from '@gcix/gcix'

const jobProps: JobProps = { ... }

Properties

Name Type Description
scripts string[] No description.
allowFailure boolean | number[] No description.
artifacts Artifacts No description.
cache Cache No description.
dependencies Job | JobCollection[] No description.
image string | Image No description.
name string No description.
needs Job | JobCollection | Need[] No description.
rules Rule[] No description.
stage string No description.
tags string[] No description.
variables {[ key: string ]: string} No description.

scriptsRequired
public readonly scripts: string[];
  • Type: string[]

allowFailureOptional
public readonly allowFailure: boolean | number[];
  • Type: boolean | number[]

artifactsOptional
public readonly artifacts: Artifacts;

cacheOptional
public readonly cache: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection[];

imageOptional
public readonly image: string | Image;

nameOptional
public readonly name: string;
  • Type: string

needsOptional
public readonly needs: Job | JobCollection | Need[];

rulesOptional
public readonly rules: Rule[];

stageOptional
public readonly stage: string;
  • Type: string

tagsOptional
public readonly tags: string[];
  • Type: string[]

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

NeedProps

Initializer

1
2
3
import { NeedProps } from '@gcix/gcix'

const needProps: NeedProps = { ... }

Properties

Name Type Description
artifacts boolean No description.
job string No description.
pipeline string No description.
project string No description.
ref string No description.

artifactsOptional
public readonly artifacts: boolean;
  • Type: boolean
  • Default: true

jobOptional
public readonly job: string;
  • Type: string
  • Default: undefined but requires pipeline to be set.

pipelineOptional
public readonly pipeline: string;
  • Type: string
  • Default: undefined which requires job to be set.

projectOptional
public readonly project: string;
  • Type: string
  • Default: undefined

refOptional
public readonly ref: string;
  • Type: string
  • Default: undefined

PipelineProps

Initializer

1
2
3
import { PipelineProps } from '@gcix/gcix'

const pipelineProps: PipelineProps = { ... }

Properties

Name Type Description
includes Include[] You can add global gcix.Includes to the pipeline. Gitlab CI Documentation: "Use include to include external YAML files in your CI/CD configuration.".

includesOptional
public readonly includes: Include[];

You can add global gcix.Includes to the pipeline. Gitlab CI Documentation: "Use include to include external YAML files in your CI/CD configuration.".


RenderedImage

This module represents the Gitlab CI Image keyword. Use Image to specify a Docker image to use for the gcix.Job.

Instances of this class are intended to be immutable. Image objects are typically defined in a central location and often reused throughout the codebase. Modifying an Image object at one place may result in unexpected changes at any other reference to that object. Therefore, this class does not provide any setter methods to modify its properties directly.

However, you can create an altered copy of an Image object using the .withTag() and .withEntrypoint() methods. These methods return a new Image object with the specified modifications, allowing you to reuse the original Image object while making specific changes for a particular use case.

By following this approach, you can maintain a central repository of Image objects and easily create customized versions as needed, without affecting the original object or introducing unintended side effects.

Initializer

1
2
3
import { RenderedImage } from '@gcix/gcix'

const renderedImage: RenderedImage = { ... }

Properties

Name Type Description
name string No description.
entrypoint string[] No description.

nameRequired
public readonly name: string;
  • Type: string

entrypointOptional
public readonly entrypoint: string[];
  • Type: string[]

RenderedIncludeArtifact

Initializer

1
2
3
import { RenderedIncludeArtifact } from '@gcix/gcix'

const renderedIncludeArtifact: RenderedIncludeArtifact = { ... }

Properties

Name Type Description
artifact string No description.
job string No description.

artifactRequired
public readonly artifact: string;
  • Type: string

jobRequired
public readonly job: string;
  • Type: string

RenderedIncludeFile

Initializer

1
2
3
import { RenderedIncludeFile } from '@gcix/gcix'

const renderedIncludeFile: RenderedIncludeFile = { ... }

Properties

Name Type Description
file string No description.
project string No description.
ref string No description.

fileRequired
public readonly file: string;
  • Type: string

projectRequired
public readonly project: string;
  • Type: string

refOptional
public readonly ref: string;
  • Type: string

RenderedIncludeLocal

Initializer

1
2
3
import { RenderedIncludeLocal } from '@gcix/gcix'

const renderedIncludeLocal: RenderedIncludeLocal = { ... }

Properties

Name Type Description
local string No description.

localRequired
public readonly local: string;
  • Type: string

RenderedIncludeRemote

Initializer

1
2
3
import { RenderedIncludeRemote } from '@gcix/gcix'

const renderedIncludeRemote: RenderedIncludeRemote = { ... }

Properties

Name Type Description
remote string No description.

remoteRequired
public readonly remote: string;
  • Type: string

RenderedIncludeTemplate

Initializer

1
2
3
import { RenderedIncludeTemplate } from '@gcix/gcix'

const renderedIncludeTemplate: RenderedIncludeTemplate = { ... }

Properties

Name Type Description
template string No description.

templateRequired
public readonly template: string;
  • Type: string

RenderedJob

Initializer

1
2
3
import { RenderedJob } from '@gcix/gcix'

const renderedJob: RenderedJob = { ... }

RuleProps

Initializer

1
2
3
import { RuleProps } from '@gcix/gcix'

const ruleProps: RuleProps = { ... }

Properties

Name Type Description
allowFailure boolean No description.
changes string[] No description.
exists string[] No description.
ifStatement string No description.
variables {[ key: string ]: string} No description.
when WhenStatement No description.

allowFailureOptional
public readonly allowFailure: boolean;
  • Type: boolean
  • Default: false

changesOptional
public readonly changes: string[];
  • Type: string[]

existsOptional
public readonly exists: string[];
  • Type: string[]

ifStatementOptional
public readonly ifStatement: string;
  • Type: string

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

whenOptional
public readonly when: WhenStatement;

ServiceProps

Initializer

1
2
3
import { ServiceProps } from '@gcix/gcix'

const serviceProps: ServiceProps = { ... }

Properties

Name Type Description
name string No description.

nameRequired
public readonly name: string;
  • Type: string

TriggerJobProps

Initializer

1
2
3
import { TriggerJobProps } from '@gcix/gcix'

const triggerJobProps: TriggerJobProps = { ... }

Properties

Name Type Description
branch string No description.
includes IncludeLocal | IncludeFile | IncludeRemote | IncludeTemplate | IncludeArtifact[] No description.
name string No description.
project string No description.
stage string No description.
strategy string No description.

branchOptional
public readonly branch: string;
  • Type: string

includesOptional
public readonly includes: IncludeLocal | IncludeFile | IncludeRemote | IncludeTemplate | IncludeArtifact[];

nameOptional
public readonly name: string;
  • Type: string

projectOptional
public readonly project: string;
  • Type: string

stageOptional
public readonly stage: string;
  • Type: string

strategyOptional
public readonly strategy: string;
  • Type: string

Classes

Artifacts

This class represents the artifacts keyword.

Gitlab CI documentation: "Use artifacts to specify a list of files and directories that are attached to the gcix.Job when it succeeds, fails, or always. [...] by default, gcix.Jobs in later stages automatically download all the artifacts created by jobs in earlier stages. You can control artifact download behavior in Job's with dependencies."

Initializers

1
2
3
import { Artifacts } from '@gcix/gcix'

new Artifacts(props: ArtifactsProps)
Name Type Description
props ArtifactsProps No description.

propsRequired

Methods

Name Description
addExcludes No description.
addPaths No description.
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

addExcludes
public addExcludes(excludes: string[]): void
excludesRequired
  • Type: string[]

addPaths
public addPaths(paths: string[]): void
pathsRequired
  • Type: string[]

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
excludes string[] No description.
paths string[] No description.
expireIn string No description.
exposeAs string No description.
name string No description.
public boolean No description.
reports ArtifactsReport[] No description.
untracked boolean No description.
when WhenStatement No description.
orderedExcludes OrderedStringSet No description.
orderedPaths OrderedStringSet No description.

excludesRequired
public readonly excludes: string[];
  • Type: string[]

pathsRequired
public readonly paths: string[];
  • Type: string[]

expireInOptional
public readonly expireIn: string;
  • Type: string

exposeAsOptional
public readonly exposeAs: string;
  • Type: string

nameOptional
public readonly name: string;
  • Type: string

publicOptional
public readonly public: boolean;
  • Type: boolean

reportsOptional
public readonly reports: ArtifactsReport[];

untrackedOptional
public readonly untracked: boolean;
  • Type: boolean

whenOptional
public readonly when: WhenStatement;

orderedExcludesRequired
public readonly orderedExcludes: OrderedStringSet;

orderedPathsRequired
public readonly orderedPaths: OrderedStringSet;

Cache

This class represents the cache keyword.

Gitlab CI documentation:

"Use cache to specify a list of files and directories to cache between gcix.Jobs. [...] Caching is shared between gcix.Pipelines and gcix.Jobs. Caches are restored before artifacts."

Initializers

1
2
3
import { Cache } from '@gcix/gcix'

new Cache(props: CacheProps)
Name Type Description
props CacheProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
cacheKey CacheKey No description.
paths string[] No description.
policy CachePolicy No description.
untracked boolean No description.
when WhenStatement No description.

cacheKeyRequired
public readonly cacheKey: CacheKey;

pathsRequired
public readonly paths: string[];
  • Type: string[]

policyOptional
public readonly policy: CachePolicy;

untrackedOptional
public readonly untracked: boolean;
  • Type: boolean

whenOptional
public readonly when: WhenStatement;

CacheKey

This class represents the cache:key keyword.

Gitlab CI documentation: "The key keyword defines the affinity of caching between jobs. You can have a single cache for all jobs, cache per-job, cache per-branch, or any other way that fits your workflow."

Initializers

1
2
3
import { CacheKey } from '@gcix/gcix'

new CacheKey(props: CacheKeyProps)
Name Type Description
props CacheKeyProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
files string[] No description.
key string No description.
prefix string No description.

filesOptional
public readonly files: string[];
  • Type: string[]

keyOptional
public readonly key: string;
  • Type: string

prefixOptional
public readonly prefix: string;
  • Type: string

Image

Initializers

1
2
3
import { Image } from '@gcix/gcix'

new Image(props: ImageProps)
Name Type Description
props ImageProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.
withEntrypoint No description.
withTag No description.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

withEntrypoint
public withEntrypoint(entrypoint: string[]): Image
entrypointRequired
  • Type: string[]

withTag
public withTag(tag: string): Image
tagRequired
  • Type: string

Properties

Name Type Description
name string No description.
entrypoint string[] No description.
tag string No description.

nameRequired
public readonly name: string;
  • Type: string

entrypointOptional
public readonly entrypoint: string[];
  • Type: string[]

tagOptional
public readonly tag: string;
  • Type: string

Include

This is just an abstract superclass.

Please use one of the subclasses:

  • IncludeLocal
  • IncludeFile
  • IncludeRemote
  • IncludeTemplate
  • IncludeArtifact

Initializers

1
2
3
import { Include } from '@gcix/gcix'

new Include()
Name Type Description

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
rendered any No description.

renderedRequired
public readonly rendered: any;
  • Type: any

IncludeArtifact

Initializers

1
2
3
import { IncludeArtifact } from '@gcix/gcix'

new IncludeArtifact(props: IncludeArtifactProps)
Name Type Description
props IncludeArtifactProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
rendered any No description.

renderedRequired
public readonly rendered: any;
  • Type: any

IncludeFile

This module represents the Gitlab CI include:file keyword.

Initializers

1
2
3
import { IncludeFile } from '@gcix/gcix'

new IncludeFile(props: IncludeFileProps)
Name Type Description
props IncludeFileProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
rendered any No description.

renderedRequired
public readonly rendered: any;
  • Type: any

IncludeLocal

This module represents the Gitlab CI include:local keyword.

Initializers

1
2
3
import { IncludeLocal } from '@gcix/gcix'

new IncludeLocal(props: IncludeLocalProps)
Name Type Description
props IncludeLocalProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
rendered any No description.

renderedRequired
public readonly rendered: any;
  • Type: any

IncludeRemote

Initializers

1
2
3
import { IncludeRemote } from '@gcix/gcix'

new IncludeRemote(props: IncludeRemoteProps)
Name Type Description
props IncludeRemoteProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
rendered any No description.

renderedRequired
public readonly rendered: any;
  • Type: any

IncludeTemplate

Initializers

1
2
3
import { IncludeTemplate } from '@gcix/gcix'

new IncludeTemplate(props: IncludeTemplateProps)
Name Type Description
props IncludeTemplateProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
rendered any No description.

renderedRequired
public readonly rendered: any;
  • Type: any

Job

This class represents the Gitlab CI Job.

Initializers

1
2
3
import { Job } from '@gcix/gcix'

new Job(props: JobProps)
Name Type Description
props JobProps No description.

propsRequired

Methods

Name Description
addDependencies No description.
addNeeds No description.
addParent This method is called by gcix.JobCollections when the job is added to that JobCollection.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignAllowFailure No description.
assignArtifacts No description.
assignCache No description.
assignDependencies No description.
assignImage Sets the image of this job.
assignNeeds No description.
assignTags No description.
copy Returns an independent, deep copy object of this job.
extendName This method is used by gcix.JobCollections to populate the jobs name.
extendStage This method is used by gcix.JobCollections to populate the jobs name and stage.
extendStageValue This method is used by gcix.JobCollections to populate the jobs stage.
getAllInstanceNames Return all instance names from the given child.
isEqual isEqual checks if this object is equal to given object.
prependRules No description.
prependScripts No description.
render Returns a representation of any object which implements IBase.

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

addParent
public addParent(parent: Job | JobCollection): void

This method is called by gcix.JobCollections when the job is added to that JobCollection.

The job needs to know its parents when getAllInstanceNames() is called.

parentRequired

addTags
public addTags(tags: string[]): Job
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): Job
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): Job
rulesRequired

appendScripts
public appendScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

assignAllowFailure
public assignAllowFailure(allowFailure: boolean | number[]): Job
allowFailureRequired
  • Type: boolean | number[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): Job
artifactsRequired

assignCache
public assignCache(cache: Cache): Job
cacheRequired

assignDependencies
public assignDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

assignImage
public assignImage(image: string | Image): Job

Sets the image of this job.

For a simple container image you can provide the origin of the image. If you want to set the entrypoint, you have to provide an Image object instead.

!! Any previous values will be overwritten.

imageRequired

assignNeeds
public assignNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

assignTags
public assignTags(tags: string[]): Job
tagsRequired
  • Type: string[]

copy
public copy(): Job

Returns an independent, deep copy object of this job.

extendName
public extendName(name: string): void

This method is used by gcix.JobCollections to populate the jobs name.

nameRequired
  • Type: string

extendStage
public extendStage(stage: string): void

This method is used by gcix.JobCollections to populate the jobs name and stage.

stageRequired
  • Type: string

extendStageValue
public extendStageValue(stage: string): void

This method is used by gcix.JobCollections to populate the jobs stage.

stageRequired
  • Type: string

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this sequence and all parent sequences.

childOptional

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

prependRules
public prependRules(rules: Rule[]): Job
rulesRequired

prependScripts
public prependScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
tags string[] Getter method to receive added tags.
allowFailure string | boolean | number[] No description.
name string No description.
orderedTags OrderedStringSet No description.
parents Job | JobCollection[] No description.
scripts string[] No description.
stage string No description.
artifacts Artifacts No description.
cache Cache No description.
dependencies Job | JobCollection | Need[] No description.
image Image No description.
needs Job | JobCollection | Need[] No description.
original Job No description.
rules Rule[] No description.
variables {[ key: string ]: string} No description.

tagsRequired
public readonly tags: string[];
  • Type: string[]

Getter method to receive added tags.


allowFailureRequired
public readonly allowFailure: string | boolean | number[];
  • Type: string | boolean | number[]

nameRequired
public readonly name: string;
  • Type: string

orderedTagsRequired
public readonly orderedTags: OrderedStringSet;

parentsRequired
public readonly parents: Job | JobCollection[];

scriptsRequired
public readonly scripts: string[];
  • Type: string[]

stageRequired
public readonly stage: string;
  • Type: string

artifactsOptional
public readonly artifacts: Artifacts;

cacheOptional
public readonly cache: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];

imageOptional
public readonly image: Image;

needsOptional
public readonly needs: Job | JobCollection | Need[];

originalOptional
public readonly original: Job;

rulesOptional
public readonly rules: Rule[];

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

JobCollection

A JobCollection collects multiple gcix.Jobs and/or other gcix.JobCollections into a group.

Initializers

1
2
3
import { JobCollection } from '@gcix/gcix'

new JobCollection()
Name Type Description

Methods

Name Description
addChildren Add gcix.Jobs or other gcix.JobCollections to this JobCollection.
addDependencies No description.
addNeeds No description.
addParent No description.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignArtifacts No description.
assignCache No description.
getAllInstanceNames Return all instance names from the given child.
initializeAllowFailure Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection that haven't been set the allowFailure before.
initializeArtifacts Sets gcix.Job.artifacts to all jobs within this JobCollection that haven't been set the artifacs before.
initializeCache Calling gcix.Job.assigneCache() to all jobs within this JobCollection that haven't been set the cache before.
initializeDependencies Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection that haven't been added dependencies before.
initializeImage Calling gcix.Job.assignImage() to all jobs within this JobCollection.
initializeNeeds Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection that haven't been added needs before.
initializeRules Calling gcix.Job.append_rules() to all jobs within this JobCollection that haven't been added rules before.
initializeTags Calling gcix.Job.addTags([...]) to all jobs within this JobCollection that haven't been added tags before.
initializeVariables Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection that haven't been added variables before.
isEqual isEqual checks if this object is equal to given object.
overrideAllowFailure Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection overriding any previous set value.
overrideDependencies Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection and overriding any previously added dependencies to that jobs.
overrideImage Calling gcix.Job.assignImage() to all jobs within this JobCollection overriding any previous set value.
overrideNeeds Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection and overriding any previously added needs to that jobs.
overrideRules Calling gcix.Job.overrideRules() to all jobs within this JobCollection and overriding any previously added rules to that jobs.
overrideTags Calling gcix.Job.addTags([...]) to all jobs within this JobCollection and overriding any previously added tags to that jobs.
overrideVariables Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection and overriding any previously added variables to that jobs.
prependRules No description.
prependScripts No description.
render Returns a representation of any object which implements IBase.

addChildren
public addChildren(props: AddChildrenProps): JobCollection

Add gcix.Jobs or other gcix.JobCollections to this JobCollection.

Adding a child creates a copy of that child. You should provide a name or stage when adding children, to make them different from other places where they will be used.

propsRequired

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): JobCollection
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): JobCollection
needsRequired

addParent
public addParent(parent: JobCollection): void
parentRequired

addTags
public addTags(tags: string[]): JobCollection
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): JobCollection
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): JobCollection
rulesRequired

appendScripts
public appendScripts(scripts: string[]): JobCollection
scriptsRequired
  • Type: string[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): JobCollection
artifactsRequired

assignCache
public assignCache(cache: Cache): JobCollection
cacheRequired

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this JobCollection and all parent JobCollection's.

childOptional

initializeAllowFailure
public initializeAllowFailure(allowFailure: boolean | number[]): JobCollection

Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection that haven't been set the allowFailure before.

allowFailureRequired
  • Type: boolean | number[]

initializeArtifacts
public initializeArtifacts(artifacts: Artifacts): JobCollection

Sets gcix.Job.artifacts to all jobs within this JobCollection that haven't been set the artifacs before.

artifactsRequired

initializeCache
public initializeCache(cache: Cache): JobCollection

Calling gcix.Job.assigneCache() to all jobs within this JobCollection that haven't been set the cache before.

cacheRequired

initializeDependencies
public initializeDependencies(dependencies: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection that haven't been added dependencies before.

An empty parameter list means that jobs will get an empty dependency list and thus does not download artifacts by default.

dependenciesRequired

initializeImage
public initializeImage(image: string | Image): JobCollection

Calling gcix.Job.assignImage() to all jobs within this JobCollection.

imageRequired

initializeNeeds
public initializeNeeds(needs: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection that haven't been added needs before.

An empty parameter list means that jobs will get an empty dependency list and thus does not depend on other jobs by default.

needsRequired

initializeRules
public initializeRules(rules: Rule[]): JobCollection

Calling gcix.Job.append_rules() to all jobs within this JobCollection that haven't been added rules before.

rulesRequired

initializeTags
public initializeTags(tags: string[]): JobCollection

Calling gcix.Job.addTags([...]) to all jobs within this JobCollection that haven't been added tags before.

tagsRequired
  • Type: string[]

initializeVariables
public initializeVariables(variables: {[ key: string ]: string}): JobCollection

Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection that haven't been added variables before.

variablesRequired
  • Type: {[ key: string ]: string}

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

overrideAllowFailure
public overrideAllowFailure(allowFailure: boolean | number[]): JobCollection

Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection overriding any previous set value.

allowFailureRequired
  • Type: boolean | number[]

overrideDependencies
public overrideDependencies(dependencies: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection and overriding any previously added dependencies to that jobs.

An empty parameter list means that jobs will get an empty dependency list and thus does not download artifacts.

dependenciesRequired

overrideImage
public overrideImage(image: string | Image): JobCollection

Calling gcix.Job.assignImage() to all jobs within this JobCollection overriding any previous set value.

imageRequired

overrideNeeds
public overrideNeeds(needs: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection and overriding any previously added needs to that jobs.

An empty parameter list means that jobs will get an empty dependency list and thus does not depend on other jobs.

needsRequired

overrideRules
public overrideRules(rules: Rule[]): JobCollection

Calling gcix.Job.overrideRules() to all jobs within this JobCollection and overriding any previously added rules to that jobs.

rulesRequired

overrideTags
public overrideTags(tags: string[]): JobCollection

Calling gcix.Job.addTags([...]) to all jobs within this JobCollection and overriding any previously added tags to that jobs.

tagsRequired
  • Type: string[]

overrideVariables
public overrideVariables(variables: {[ key: string ]: string}): JobCollection

Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection and overriding any previously added variables to that jobs.

variablesRequired
  • Type: {[ key: string ]: string}

prependRules
public prependRules(rules: Rule[]): JobCollection
rulesRequired

prependScripts
public prependScripts(scripts: string[]): JobCollection
scriptsRequired
  • Type: string[]

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
lastJobsExecuted Job[] This property returns all Jobs from the last stage of this JobCollection.
nestedJobs Job[] No description.
populatedJobs Job[] Returns a list with populated copies of all nested jobs of this JobCollection.
children ChildDict[] No description.
orderedTags OrderedStringSet No description.
orderedTagsForInitialization OrderedStringSet No description.
orderedTagsForReplacement OrderedStringSet No description.
parents Job | JobCollection[] No description.
allowFailureForInitialization string | boolean | number[] No description.
allowFailureForReplacement string | boolean | number[] No description.
artifacts Artifacts No description.
artifactsForInitialization Artifacts No description.
artifactsForReplacement Artifacts No description.
cache Cache No description.
cacheForInitialization Cache No description.
dependencies Job | JobCollection | Need[] No description.
dependenciesForInitialization Job | JobCollection | Need[] No description.
dependenciesForReplacement Job | JobCollection | Need[] No description.
imageForInitialization string | Image No description.
imageForReplacement string | Image No description.
needs Job | JobCollection | Need[] No description.
needsForInitialization Job | JobCollection | Need[] No description.
needsForReplacement Job | JobCollection | Need[] No description.
rulesForInitialization Rule[] No description.
rulesForReplacement Rule[] No description.
rulesToAppend Rule[] No description.
rulesToPrepend Rule[] No description.
scriptsToAppend string[] No description.
scriptsToPrepend string[] No description.
variables {[ key: string ]: string} No description.
variablesForInitialization {[ key: string ]: string} No description.
variablesForReplacement {[ key: string ]: string} No description.

lastJobsExecutedRequired
public readonly lastJobsExecuted: Job[];

This property returns all Jobs from the last stage of this JobCollection.

This is typically be requested from a job which has setup this JobCollection as need, to determine all actual jobs of this JobCollection as need.


nestedJobsRequired
public readonly nestedJobs: Job[];

populatedJobsRequired
public readonly populatedJobs: Job[];

Returns a list with populated copies of all nested jobs of this JobCollection.

Populated means, that all attributes of a Job which depends on its context are resolved to their final values. The context is primarily the JobCollection within the jobs resides but also dependencies to other jobs and JobCollection's. Thus this JobCollection will apply its own configuration, like variables to add, tags to set, etc., to all its jobs and JobCollection's.

Copies means what it says, that the returned job are not the same job objects, originally added to this JobCollection, but copies of them.

Nested means, that also jobs from JobCollection's within this JobCollection, are returned, as well as jobs from JobCollection's within JobCollection's within this JobCollection and so on.


childrenRequired
public readonly children: ChildDict[];

orderedTagsRequired
public readonly orderedTags: OrderedStringSet;

orderedTagsForInitializationRequired
public readonly orderedTagsForInitialization: OrderedStringSet;

orderedTagsForReplacementRequired
public readonly orderedTagsForReplacement: OrderedStringSet;

parentsRequired
public readonly parents: Job | JobCollection[];

allowFailureForInitializationOptional
public readonly allowFailureForInitialization: string | boolean | number[];
  • Type: string | boolean | number[]

allowFailureForReplacementOptional
public readonly allowFailureForReplacement: string | boolean | number[];
  • Type: string | boolean | number[]

artifactsOptional
public readonly artifacts: Artifacts;

artifactsForInitializationOptional
public readonly artifactsForInitialization: Artifacts;

artifactsForReplacementOptional
public readonly artifactsForReplacement: Artifacts;

cacheOptional
public readonly cache: Cache;

cacheForInitializationOptional
public readonly cacheForInitialization: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];

dependenciesForInitializationOptional
public readonly dependenciesForInitialization: Job | JobCollection | Need[];

dependenciesForReplacementOptional
public readonly dependenciesForReplacement: Job | JobCollection | Need[];

imageForInitializationOptional
public readonly imageForInitialization: string | Image;

imageForReplacementOptional
public readonly imageForReplacement: string | Image;

needsOptional
public readonly needs: Job | JobCollection | Need[];

needsForInitializationOptional
public readonly needsForInitialization: Job | JobCollection | Need[];

needsForReplacementOptional
public readonly needsForReplacement: Job | JobCollection | Need[];

rulesForInitializationOptional
public readonly rulesForInitialization: Rule[];

rulesForReplacementOptional
public readonly rulesForReplacement: Rule[];

rulesToAppendOptional
public readonly rulesToAppend: Rule[];

rulesToPrependOptional
public readonly rulesToPrepend: Rule[];

scriptsToAppendOptional
public readonly scriptsToAppend: string[];
  • Type: string[]

scriptsToPrependOptional
public readonly scriptsToPrepend: string[];
  • Type: string[]

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

variablesForInitializationOptional
public readonly variablesForInitialization: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

variablesForReplacementOptional
public readonly variablesForReplacement: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Need

This class represents the Gitlab CI needs keyword. The needs key-word adds a possibility to allow out-of-order Gitlab CI jobs. A job which needed another job runs directly after the other job as finished successfully.

Initializers

1
2
3
import { Need } from '@gcix/gcix'

new Need(props: NeedProps)
Name Type Description
props NeedProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
artifacts boolean No description.
job string No description.
pipeline string No description.
project string No description.
ref string No description.

artifactsOptional
public readonly artifacts: boolean;
  • Type: boolean

jobOptional
public readonly job: string;
  • Type: string

pipelineOptional
public readonly pipeline: string;
  • Type: string

projectOptional
public readonly project: string;
  • Type: string

refOptional
public readonly ref: string;
  • Type: string

OrderedStringSet

Represents an ordered set of strings.

Initializers

1
2
3
import { OrderedStringSet } from '@gcix/gcix'

new OrderedStringSet(values?: string[])
Name Type Description
values string[] An optional array of values to initialize the set.

valuesOptional
  • Type: string[]

An optional array of values to initialize the set.


Methods

Name Description
add Adds a value or an array of values to the set.
clear Clears the set, removing all values.
delete Deletes a value from the set.
has Checks if the set contains a specific value.

add
public add(value: string | string[]): void

Adds a value or an array of values to the set.

valueRequired
  • Type: string | string[]

The value(s) to add.


clear
public clear(): void

Clears the set, removing all values.

delete
public delete(value: string): void

Deletes a value from the set.

valueRequired
  • Type: string

The value to delete.


has
public has(value: string): boolean

Checks if the set contains a specific value.

valueRequired
  • Type: string

The value to check.


Properties

Name Type Description
size number Returns the number of values in the set.
values string[] Returns an array of values in the set.

sizeRequired
public readonly size: number;
  • Type: number

Returns the number of values in the set.


valuesRequired
public readonly values: string[];
  • Type: string[]

Returns an array of values in the set.


PagesJob

This is a special kind of jobs which deploys Gitlab Pages.

This job has the static name pages and the static artifacts path ./public. Both preconfigurations can't be altered and are required for deploying Gitlab Pages properly. All methods which would typically alter the name, stage and artifacts of a job are overwritten with an empty implementation.

This job is only for deploying Gitlab Pages artifacts within the ./public artifacts path. To create the artifacts you have to run jobs, that generate those artifacts within the same ./public artifacts path, before this PagesJob in the pipeline.

Because the name of the job can't be altered, this job may only exist once in the generated pipeline output. Typically you should add the PagesJob to the gcix.Pipeline.

The PagesJob is also preconfigured with the stage pages and the image alpine:latest. To change the stage of this job, use the assignStage() method. Please mention to run this job in a stage after all jobs, that fill the public artifacts path with content.

Here a simple example how to use the GitlabPages job:

1
2
3
4
5
const pipeline = new Pipeline()
pipeline.addChildren({
    new Job({stage: "deploy", scripts: ["./create-html.sh"]).assingArtifacts(new Artifacts({paths: ["public"]})}),
    new PagesJob(),
})

Initializers

1
2
3
import { PagesJob } from '@gcix/gcix'

new PagesJob()
Name Type Description

Methods

Name Description
addDependencies No description.
addNeeds No description.
addParent This method is called by gcix.JobCollections when the job is added to that JobCollection.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignAllowFailure No description.
assignArtifacts No description.
assignCache No description.
assignDependencies No description.
assignImage Sets the image of this job.
assignNeeds No description.
assignTags No description.
copy Returns an independent, deep copy object of this job.
extendName This method is used by gcix.JobCollections to populate the jobs name.
extendStage This method is used by gcix.JobCollections to populate the jobs name and stage.
extendStageValue This method is used by gcix.JobCollections to populate the jobs stage.
getAllInstanceNames Return all instance names from the given child.
isEqual isEqual checks if this object is equal to given object.
prependRules No description.
prependScripts No description.
render Returns a representation of any object which implements IBase.
assignStage Set the name of this jobs stage to a value other than pages.

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

addParent
public addParent(parent: Job | JobCollection): void

This method is called by gcix.JobCollections when the job is added to that JobCollection.

The job needs to know its parents when getAllInstanceNames() is called.

parentRequired

addTags
public addTags(tags: string[]): Job
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): Job
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): Job
rulesRequired

appendScripts
public appendScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

assignAllowFailure
public assignAllowFailure(allowFailure: boolean | number[]): Job
allowFailureRequired
  • Type: boolean | number[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): Job
artifactsRequired

assignCache
public assignCache(cache: Cache): Job
cacheRequired

assignDependencies
public assignDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

assignImage
public assignImage(image: string | Image): Job

Sets the image of this job.

For a simple container image you can provide the origin of the image. If you want to set the entrypoint, you have to provide an Image object instead.

!! Any previous values will be overwritten.

imageRequired

assignNeeds
public assignNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

assignTags
public assignTags(tags: string[]): Job
tagsRequired
  • Type: string[]

copy
public copy(): Job

Returns an independent, deep copy object of this job.

extendName
public extendName(name: string): void

This method is used by gcix.JobCollections to populate the jobs name.

nameRequired
  • Type: string

extendStage
public extendStage(name: string): void

This method is used by gcix.JobCollections to populate the jobs name and stage.

nameRequired
  • Type: string

extendStageValue
public extendStageValue(name: string): void

This method is used by gcix.JobCollections to populate the jobs stage.

nameRequired
  • Type: string

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this sequence and all parent sequences.

childOptional

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

prependRules
public prependRules(rules: Rule[]): Job
rulesRequired

prependScripts
public prependScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

assignStage
public assignStage(stage: string): PagesJob

Set the name of this jobs stage to a value other than pages.

stageRequired
  • Type: string

Properties

Name Type Description
tags string[] Getter method to receive added tags.
allowFailure string | boolean | number[] No description.
name string No description.
orderedTags OrderedStringSet No description.
parents Job | JobCollection[] No description.
scripts string[] No description.
stage string No description.
artifacts Artifacts No description.
cache Cache No description.
dependencies Job | JobCollection | Need[] No description.
image Image No description.
needs Job | JobCollection | Need[] No description.
original Job No description.
rules Rule[] No description.
variables {[ key: string ]: string} No description.

tagsRequired
public readonly tags: string[];
  • Type: string[]

Getter method to receive added tags.


allowFailureRequired
public readonly allowFailure: string | boolean | number[];
  • Type: string | boolean | number[]

nameRequired
public readonly name: string;
  • Type: string

orderedTagsRequired
public readonly orderedTags: OrderedStringSet;

parentsRequired
public readonly parents: Job | JobCollection[];

scriptsRequired
public readonly scripts: string[];
  • Type: string[]

stageRequired
public readonly stage: string;
  • Type: string

artifactsOptional
public readonly artifacts: Artifacts;

cacheOptional
public readonly cache: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];

imageOptional
public readonly image: Image;

needsOptional
public readonly needs: Job | JobCollection | Need[];

originalOptional
public readonly original: Job;

rulesOptional
public readonly rules: Rule[];

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Pipeline

Initializers

1
2
3
import { Pipeline } from '@gcix/gcix'

new Pipeline(props?: PipelineProps)
Name Type Description
props PipelineProps No description.

propsOptional

Methods

Name Description
addChildren Add gcix.Jobs or other gcix.JobCollections to this JobCollection.
addDependencies No description.
addNeeds No description.
addParent No description.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignArtifacts No description.
assignCache No description.
getAllInstanceNames Return all instance names from the given child.
initializeAllowFailure Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection that haven't been set the allowFailure before.
initializeArtifacts Sets gcix.Job.artifacts to all jobs within this JobCollection that haven't been set the artifacs before.
initializeCache Calling gcix.Job.assigneCache() to all jobs within this JobCollection that haven't been set the cache before.
initializeDependencies Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection that haven't been added dependencies before.
initializeImage Calling gcix.Job.assignImage() to all jobs within this JobCollection.
initializeNeeds Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection that haven't been added needs before.
initializeRules Calling gcix.Job.append_rules() to all jobs within this JobCollection that haven't been added rules before.
initializeTags Calling gcix.Job.addTags([...]) to all jobs within this JobCollection that haven't been added tags before.
initializeVariables Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection that haven't been added variables before.
isEqual isEqual checks if this object is equal to given object.
overrideAllowFailure Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection overriding any previous set value.
overrideDependencies Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection and overriding any previously added dependencies to that jobs.
overrideImage Calling gcix.Job.assignImage() to all jobs within this JobCollection overriding any previous set value.
overrideNeeds Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection and overriding any previously added needs to that jobs.
overrideRules Calling gcix.Job.overrideRules() to all jobs within this JobCollection and overriding any previously added rules to that jobs.
overrideTags Calling gcix.Job.addTags([...]) to all jobs within this JobCollection and overriding any previously added tags to that jobs.
overrideVariables Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection and overriding any previously added variables to that jobs.
prependRules No description.
prependScripts No description.
render Returns a representation of any object which implements IBase.
addInclude Let you add global gcix.Includes to the pipeline. Gitlab CI Documentation: "Use include to include external YAML files in your CI/CD configuration.".
addServices Add one or more gcix.Services to the pipeline.
writeYaml Create the Gitlab CI YAML file from this pipeline object.

addChildren
public addChildren(props: AddChildrenProps): JobCollection

Add gcix.Jobs or other gcix.JobCollections to this JobCollection.

Adding a child creates a copy of that child. You should provide a name or stage when adding children, to make them different from other places where they will be used.

propsRequired

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): JobCollection
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): JobCollection
needsRequired

addParent
public addParent(parent: JobCollection): void
parentRequired

addTags
public addTags(tags: string[]): JobCollection
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): JobCollection
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): JobCollection
rulesRequired

appendScripts
public appendScripts(scripts: string[]): JobCollection
scriptsRequired
  • Type: string[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): JobCollection
artifactsRequired

assignCache
public assignCache(cache: Cache): JobCollection
cacheRequired

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this JobCollection and all parent JobCollection's.

childOptional

initializeAllowFailure
public initializeAllowFailure(allowFailure: boolean | number[]): JobCollection

Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection that haven't been set the allowFailure before.

allowFailureRequired
  • Type: boolean | number[]

initializeArtifacts
public initializeArtifacts(artifacts: Artifacts): JobCollection

Sets gcix.Job.artifacts to all jobs within this JobCollection that haven't been set the artifacs before.

artifactsRequired

initializeCache
public initializeCache(cache: Cache): JobCollection

Calling gcix.Job.assigneCache() to all jobs within this JobCollection that haven't been set the cache before.

cacheRequired

initializeDependencies
public initializeDependencies(dependencies: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection that haven't been added dependencies before.

An empty parameter list means that jobs will get an empty dependency list and thus does not download artifacts by default.

dependenciesRequired

initializeImage
public initializeImage(image: string | Image): JobCollection

Calling gcix.Job.assignImage() to all jobs within this JobCollection.

imageRequired

initializeNeeds
public initializeNeeds(needs: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection that haven't been added needs before.

An empty parameter list means that jobs will get an empty dependency list and thus does not depend on other jobs by default.

needsRequired

initializeRules
public initializeRules(rules: Rule[]): JobCollection

Calling gcix.Job.append_rules() to all jobs within this JobCollection that haven't been added rules before.

rulesRequired

initializeTags
public initializeTags(tags: string[]): JobCollection

Calling gcix.Job.addTags([...]) to all jobs within this JobCollection that haven't been added tags before.

tagsRequired
  • Type: string[]

initializeVariables
public initializeVariables(variables: {[ key: string ]: string}): JobCollection

Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection that haven't been added variables before.

variablesRequired
  • Type: {[ key: string ]: string}

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

overrideAllowFailure
public overrideAllowFailure(allowFailure: boolean | number[]): JobCollection

Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection overriding any previous set value.

allowFailureRequired
  • Type: boolean | number[]

overrideDependencies
public overrideDependencies(dependencies: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection and overriding any previously added dependencies to that jobs.

An empty parameter list means that jobs will get an empty dependency list and thus does not download artifacts.

dependenciesRequired

overrideImage
public overrideImage(image: string | Image): JobCollection

Calling gcix.Job.assignImage() to all jobs within this JobCollection overriding any previous set value.

imageRequired

overrideNeeds
public overrideNeeds(needs: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection and overriding any previously added needs to that jobs.

An empty parameter list means that jobs will get an empty dependency list and thus does not depend on other jobs.

needsRequired

overrideRules
public overrideRules(rules: Rule[]): JobCollection

Calling gcix.Job.overrideRules() to all jobs within this JobCollection and overriding any previously added rules to that jobs.

rulesRequired

overrideTags
public overrideTags(tags: string[]): JobCollection

Calling gcix.Job.addTags([...]) to all jobs within this JobCollection and overriding any previously added tags to that jobs.

tagsRequired
  • Type: string[]

overrideVariables
public overrideVariables(variables: {[ key: string ]: string}): JobCollection

Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection and overriding any previously added variables to that jobs.

variablesRequired
  • Type: {[ key: string ]: string}

prependRules
public prependRules(rules: Rule[]): JobCollection
rulesRequired

prependScripts
public prependScripts(scripts: string[]): JobCollection
scriptsRequired
  • Type: string[]

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

addInclude
public addInclude(include: Include): Pipeline

Let you add global gcix.Includes to the pipeline. Gitlab CI Documentation: "Use include to include external YAML files in your CI/CD configuration.".

includeRequired

addServices
public addServices(services: Service[]): Pipeline

Add one or more gcix.Services to the pipeline.

Gitlab CI Documentation: "The services keyword defines a Docker image that runs during a job linked to the Docker image that the image keyword defines."

servicesRequired

writeYaml
public writeYaml(filename?: string): void

Create the Gitlab CI YAML file from this pipeline object.

Use that YAML file to trigger a child pipeline.

filenameOptional
  • Type: string

Properties

Name Type Description
lastJobsExecuted Job[] This property returns all Jobs from the last stage of this JobCollection.
nestedJobs Job[] No description.
populatedJobs Job[] Returns a list with populated copies of all nested jobs of this JobCollection.
children ChildDict[] No description.
orderedTags OrderedStringSet No description.
orderedTagsForInitialization OrderedStringSet No description.
orderedTagsForReplacement OrderedStringSet No description.
parents Job | JobCollection[] No description.
allowFailureForInitialization string | boolean | number[] No description.
allowFailureForReplacement string | boolean | number[] No description.
artifacts Artifacts No description.
artifactsForInitialization Artifacts No description.
artifactsForReplacement Artifacts No description.
cache Cache No description.
cacheForInitialization Cache No description.
dependencies Job | JobCollection | Need[] No description.
dependenciesForInitialization Job | JobCollection | Need[] No description.
dependenciesForReplacement Job | JobCollection | Need[] No description.
imageForInitialization string | Image No description.
imageForReplacement string | Image No description.
needs Job | JobCollection | Need[] No description.
needsForInitialization Job | JobCollection | Need[] No description.
needsForReplacement Job | JobCollection | Need[] No description.
rulesForInitialization Rule[] No description.
rulesForReplacement Rule[] No description.
rulesToAppend Rule[] No description.
rulesToPrepend Rule[] No description.
scriptsToAppend string[] No description.
scriptsToPrepend string[] No description.
variables {[ key: string ]: string} No description.
variablesForInitialization {[ key: string ]: string} No description.
variablesForReplacement {[ key: string ]: string} No description.
includes Include[] No description.
service Service[] No description.

lastJobsExecutedRequired
public readonly lastJobsExecuted: Job[];

This property returns all Jobs from the last stage of this JobCollection.

This is typically be requested from a job which has setup this JobCollection as need, to determine all actual jobs of this JobCollection as need.


nestedJobsRequired
public readonly nestedJobs: Job[];

populatedJobsRequired
public readonly populatedJobs: Job[];

Returns a list with populated copies of all nested jobs of this JobCollection.

Populated means, that all attributes of a Job which depends on its context are resolved to their final values. The context is primarily the JobCollection within the jobs resides but also dependencies to other jobs and JobCollection's. Thus this JobCollection will apply its own configuration, like variables to add, tags to set, etc., to all its jobs and JobCollection's.

Copies means what it says, that the returned job are not the same job objects, originally added to this JobCollection, but copies of them.

Nested means, that also jobs from JobCollection's within this JobCollection, are returned, as well as jobs from JobCollection's within JobCollection's within this JobCollection and so on.


childrenRequired
public readonly children: ChildDict[];

orderedTagsRequired
public readonly orderedTags: OrderedStringSet;

orderedTagsForInitializationRequired
public readonly orderedTagsForInitialization: OrderedStringSet;

orderedTagsForReplacementRequired
public readonly orderedTagsForReplacement: OrderedStringSet;

parentsRequired
public readonly parents: Job | JobCollection[];

allowFailureForInitializationOptional
public readonly allowFailureForInitialization: string | boolean | number[];
  • Type: string | boolean | number[]

allowFailureForReplacementOptional
public readonly allowFailureForReplacement: string | boolean | number[];
  • Type: string | boolean | number[]

artifactsOptional
public readonly artifacts: Artifacts;

artifactsForInitializationOptional
public readonly artifactsForInitialization: Artifacts;

artifactsForReplacementOptional
public readonly artifactsForReplacement: Artifacts;

cacheOptional
public readonly cache: Cache;

cacheForInitializationOptional
public readonly cacheForInitialization: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];

dependenciesForInitializationOptional
public readonly dependenciesForInitialization: Job | JobCollection | Need[];

dependenciesForReplacementOptional
public readonly dependenciesForReplacement: Job | JobCollection | Need[];

imageForInitializationOptional
public readonly imageForInitialization: string | Image;

imageForReplacementOptional
public readonly imageForReplacement: string | Image;

needsOptional
public readonly needs: Job | JobCollection | Need[];

needsForInitializationOptional
public readonly needsForInitialization: Job | JobCollection | Need[];

needsForReplacementOptional
public readonly needsForReplacement: Job | JobCollection | Need[];

rulesForInitializationOptional
public readonly rulesForInitialization: Rule[];

rulesForReplacementOptional
public readonly rulesForReplacement: Rule[];

rulesToAppendOptional
public readonly rulesToAppend: Rule[];

rulesToPrependOptional
public readonly rulesToPrepend: Rule[];

scriptsToAppendOptional
public readonly scriptsToAppend: string[];
  • Type: string[]

scriptsToPrependOptional
public readonly scriptsToPrepend: string[];
  • Type: string[]

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

variablesForInitializationOptional
public readonly variablesForInitialization: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

variablesForReplacementOptional
public readonly variablesForReplacement: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

includesRequired
public readonly includes: Include[];

serviceRequired
public readonly service: Service[];

PredefinedVariables

This class contains constants for Gitlab CI predefined variables.

Initializers

1
2
3
import { PredefinedVariables } from '@gcix/gcix'

new PredefinedVariables()
Name Type Description

Properties

Name Type Description
chatChannel string Source chat channel which triggered the ChatOps command.
chatInput string Additional arguments passed in the ChatOps command.
ci string Mark that job is executed in CI environment.
ciApiV4Url string The GitLab API v4 root URL.
ciBuildsDir string Top-level directory where builds are executed.
ciCommitBeforeSha string The previous latest commit present on a branch. Is always 0000000000000000000000000000000000000000 in pipelines for merge requests.
ciCommitDescription string The description of the commit the message without first line, if the title is shorter than 100 characters;
ciCommitMessage string The full commit message.
ciCommitRefName string The branch or tag name for which project is built.
ciCommitRefProtected string true if the job is running on a protected reference, false if not.
ciCommitRefSlug string $CI_COMMIT_REF_NAME in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -.
ciCommitSha string The commit revision for which project is built.
ciCommitShortSha string The first eight characters of CI_COMMIT_SHA.
ciCommitTimestamp string The timestamp of the commit in the ISO 8601 format.
ciCommitTitle string The title of the commit - the full first line of the message.
ciConcurrentId string Unique ID of build execution in a single executor.
ciConcurrentProjectId string Unique ID of build execution in a single executor and project.
ciConfigPath string The path to CI configuration file. Defaults to .gitlab-ci.yml.
ciDebugTrace string Whether debug logging (tracing) is enabled.
ciDefaultBranch string The name of the default branch for the project.
ciDependencyProxyGroupImagePrefix string The image prefix for pulling images through the Dependency Proxy.
ciDependencyProxyPassword string The password to use to pull images through the Dependency Proxy.
ciDependencyProxyServer string The server for logging in to the Dependency Proxy. This is equivalent to $CI_SERVER_HOST:$CI_SERVER_PORT.
ciDependencyProxyUser string The username to use to pull images through the Dependency Proxy.
ciDeployPassword string Authentication password of the GitLab Deploy Token, only present if the Project has one related.
ciDeployUser string Authentication username of the GitLab Deploy Token, only present if the Project has one related.
ciJobId string The unique ID of the current job that GitLab CI/CD uses internally.
ciJobImage string The name of the image running the CI job.
ciJobJwt string RS256 JSON web token that can be used for authenticating with third party systems that support JWT authentication, for example HashiCorp’s Vault.
ciJobManual string The flag to indicate that job was manually started.
ciJobName string The name of the job as defined in .gitlab-ci.yml.
ciJobStage string The name of the stage as defined in .gitlab-ci.yml.
ciJobStatus string The state of the job as each runner stage is executed.
ciJobToken string Token used for authenticating with a few API endpoints and downloading dependent repositories.
ciJobUrl string Job details URL.
ciMergeRequestTargetBranchName string The target branch name of the merge request if the pipelines are for merge requests.
ciMergeRequestTargetBranchSha string The HEAD SHA of the target branch of the merge request if the pipelines are for merge requests.
ciNodeTotal string Total number of instances of this job running in parallel.
ciPagesDomain string The configured domain that hosts GitLab Pages.
ciPagesUrl string URL to GitLab Pages-built pages. Always belongs to a subdomain of CI_PAGES_DOMAIN.
ciPipelineId string The instance-level ID of the current pipeline. This is a unique ID across all projects on GitLab.
ciPipelineIid string The project-level IID (internal ID) of the current pipeline. This ID is unique for the current project.
ciPipelineSource string Indicates how the pipeline was triggered.
ciPipelineTriggered string The flag to indicate that job was triggered.
ciPipelineUrl string Pipeline details URL.
ciProjectConfigPath string The CI configuration path for the project.
ciProjectDir string The full path where the repository is cloned and where the job is run.
ciProjectId string The unique ID of the current project that GitLab CI/CD uses internally.
ciProjectName string The name of the directory for the project that is being built.
ciProjectNamespace string The project stage (username or group name) that is being built.
ciProjectPath string The stage with project name.
ciProjectPathSlug string $CI_PROJECT_PATH in lowercase and with everything except 0-9 and a-z replaced with -. Use in URLs and domain names.
ciProjectRepositoryLanguages string Comma-separated, lowercase list of the languages used in the repository (for example ruby,javascript,html,css).
ciProjectRootNamespace string The root project stage (username or group name) that is being built.
ciProjectTitle string The human-readable project name as displayed in the GitLab web interface.
ciProjectUrl string The HTTP(S) address to access project.
ciProjectVisibility string The project visibility (internal, private, public).
ciRegistryPassword string The password to use to push containers to the GitLab Container Registry, for the current project.
ciRepositoryUrl string The URL to clone the Git repository.
ciRunnerDescription string The description of the runner as saved in GitLab.
ciRunnerExecutableArch string The OS/architecture of the GitLab Runner executable (note that this is not necessarily the same as the environment of the executor).
ciRunnerId string The unique ID of runner being used.
ciRunnerRevision string GitLab Runner revision that is executing the current job.
ciRunnerShortToken string First eight characters of the runner’s token used to authenticate new job requests. Used as the runner’s unique ID.
ciRunnerTags string The defined runner tags.
ciRunnerVersion string GitLab Runner version that is executing the current job.
ciServer string Mark that job is executed in CI environment.
ciServerHost string Host component of the GitLab instance URL, without protocol and port (like gitlab.example.com).
ciServerName string The name of CI server that is used to coordinate jobs.
ciServerPort string Port component of the GitLab instance URL, without host and protocol (like 3000).
ciServerProtocol string Protocol component of the GitLab instance URL, without host and port (like https).
ciServerRevision string GitLab revision that is used to schedule jobs.
ciServerUrl string The base URL of the GitLab instance, including protocol and port (like https://gitlab.example.com:8080).
ciServerVersion string GitLab version that is used to schedule jobs.
ciServerVersionMajor string GitLab version major component.
ciServerVersionMinor string GitLab version minor component.
ciServerVersionPatch string GitLab version patch component.
gitlabCi string Mark that job is executed in GitLab CI/CD environment.
gitlabFeatures string The comma separated list of licensed features available for your instance and plan.
gitlabUserEmail string The email of the user who started the job.
gitlabUserId string The ID of the user who started the job.
gitlabUserLogin string The login username of the user who started the job.
gitlabUserName string The real name of the user who started the job.
ciCommitBranch string The commit branch name.
ciCommitTag string The commit tag name. Present only when building tags.
ciDeployFreeze string Included with the value true if the pipeline runs during a deploy freeze window.
ciDisposableEnvironment string Marks that the job is executed in a disposable environment (something that is created only for this job and disposed of/destroyed after the execution - all executors except shell and ssh).
ciEnvironmentName string The name of the environment for this job. Only present if environment:name is set.
ciEnvironmentSlug string A simplified version of the environment name, suitable for inclusion in DNS, URLs, Kubernetes labels, and so on.
ciEnvironmentUrl string The URL of the environment for this job. Only present if environment:url is set.
ciExternalPullRequestIid string Pull Request ID from GitHub if the pipelines are for external pull requests.
ciExternalPullRequestSourceBranchName string The source branch name of the pull request if the pipelines are for external pull requests.
ciExternalPullRequestSourceBranchSha string The HEAD SHA of the source branch of the pull request if the pipelines are for external pull requests.
ciExternalPullRequestSourceRepository string The source repository name of the pull request if the pipelines are for external pull requests.
ciExternalPullRequestTargetBranchName string The target branch name of the pull request if the pipelines are for external pull requests.
ciExternalPullRequestTargetBranchSha string The HEAD SHA of the target branch of the pull request if the pipelines are for external pull requests.
ciExternalPullRequestTargetRepository string The target repository name of the pull request if the pipelines are for external pull requests.
ciHasOpenRequirements string Included with the value true only if the pipeline’s project has any open requirements.
ciKubernetesActive string Included with the value true only if the pipeline has a Kubernetes cluster available for deployments.
ciMergeRequestAssignees string Comma-separated list of username(s) of assignee(s) for the merge request if the pipelines are for merge requests.
ciMergeRequestDiffBaseSha string The base SHA of the merge request diff, if the pipelines are for merge requests.
ciMergeRequestDiffId string The version of the merge request diff, if the pipelines are for merge requests.
ciMergeRequestEventType string The event type of the merge request, if the pipelines are for merge requests. Can be detached, merged_result or merge_train.
ciMergeRequestId string The instance-level ID of the merge request.
ciMergeRequestIid string The project-level IID (internal ID) of the merge request.
ciMergeRequestLabels string Comma-separated label names of the merge request if the pipelines are for merge requests.
ciMergeRequestMilestone string The milestone title of the merge request if the pipelines are for merge requests.
ciMergeRequestProjectId string The ID of the project of the merge request if the pipelines are for merge requests.
ciMergeRequestProjectPath string The path of the project of the merge request if the pipelines are for merge requests (for example stage/awesome-project).
ciMergeRequestProjectUrl string The URL of the project of the merge request if the pipelines are for merge requests (for example http://192.168.10.15:3000/stage/awesome-project). Available only if only [merge_requests] or rules syntax is used and the merge request is created. * Added in GitLab 11.6 Available in GitLab Runner all.
ciMergeRequestRefPath string The ref path of the merge request if the pipelines are for merge requests.
ciMergeRequestSourceBranchName string The source branch name of the merge request if the pipelines are for merge requests.
ciMergeRequestSourceBranchSha string The HEAD SHA of the source branch of the merge request if the pipelines are for merge requests.
ciMergeRequestSourceProjectId string The ID of the source project of the merge request if the pipelines are for merge requests.
ciMergeRequestSourceProjectPath string The path of the source project of the merge request if the pipelines are for merge requests.
ciMergeRequestSourceProjectUrl string The URL of the source project of the merge request if the pipelines are for merge requests.
ciMergeRequestTitle string The title of the merge request if the pipelines are for merge requests.
ciNodeIndex string Index of the job in the job set. If the job is not parallelized, this variable is not set.
ciOpenMergeRequests string Available in branch and merge request pipelines.
ciRegistry string GitLab Container Registry. This variable includes a :port value if one has been specified in the registry configuration.
ciRegistryImage string the address of the registry tied to the specific project.
ciRegistryUser string The username to use to push containers to the GitLab Container Registry, for the current project.
ciSharedEnvironment string Marks that the job is executed in a shared environment (something that is persisted across CI invocations like shell or ssh executor).
triggerPayload string This variable is available when a pipeline is triggered with a webhook.

chatChannelRequired
public readonly chatChannel: string;
  • Type: string

Source chat channel which triggered the ChatOps command.

Added in GitLab 10.6 Available in GitLab Runner all


chatInputRequired
public readonly chatInput: string;
  • Type: string

Additional arguments passed in the ChatOps command.

Added in GitLab 10.6 Available in GitLab Runner all


ciRequired
public readonly ci: string;
  • Type: string

Mark that job is executed in CI environment.

Added in GitLab all Available in GitLab Runner 0.4


ciApiV4UrlRequired
public readonly ciApiV4Url: string;
  • Type: string

The GitLab API v4 root URL.

Added in GitLab 11.7 Available in GitLab Runner all


ciBuildsDirRequired
public readonly ciBuildsDir: string;
  • Type: string

Top-level directory where builds are executed.

Added in GitLab all Available in GitLab Runner 11.10


ciCommitBeforeShaRequired
public readonly ciCommitBeforeSha: string;
  • Type: string

The previous latest commit present on a branch. Is always 0000000000000000000000000000000000000000 in pipelines for merge requests.

Added in GitLab 11.2 Available in GitLab Runner all


ciCommitDescriptionRequired
public readonly ciCommitDescription: string;
  • Type: string

The description of the commit the message without first line, if the title is shorter than 100 characters;

full message in other case.

Added in GitLab 10.8 Available in GitLab Runner all


ciCommitMessageRequired
public readonly ciCommitMessage: string;
  • Type: string

The full commit message.

Added in GitLab 10.8 Available in GitLab Runner all


ciCommitRefNameRequired
public readonly ciCommitRefName: string;
  • Type: string

The branch or tag name for which project is built.

Added in GitLab 9.0 Available in GitLab Runner all


ciCommitRefProtectedRequired
public readonly ciCommitRefProtected: string;
  • Type: string

true if the job is running on a protected reference, false if not.

Added in GitLab 11.11 Available in GitLab Runner all


ciCommitRefSlugRequired
public readonly ciCommitRefSlug: string;
  • Type: string

$CI_COMMIT_REF_NAME in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -.

No leading / trailing -. Use in URLs, host names and domain names.

Added in GitLab 9.0 Available in GitLab Runner all


ciCommitShaRequired
public readonly ciCommitSha: string;
  • Type: string

The commit revision for which project is built.

Added in GitLab 9.0 Available in GitLab Runner all


ciCommitShortShaRequired
public readonly ciCommitShortSha: string;
  • Type: string

The first eight characters of CI_COMMIT_SHA.

Added in GitLab 11.7 Available in GitLab Runner all


ciCommitTimestampRequired
public readonly ciCommitTimestamp: string;
  • Type: string

The timestamp of the commit in the ISO 8601 format.

Added in GitLab 13.4 Available in GitLab Runner all


ciCommitTitleRequired
public readonly ciCommitTitle: string;
  • Type: string

The title of the commit - the full first line of the message.

Added in GitLab 10.8 Available in GitLab Runner all


ciConcurrentIdRequired
public readonly ciConcurrentId: string;
  • Type: string

Unique ID of build execution in a single executor.

Added in GitLab all Available in GitLab Runner 11.10


ciConcurrentProjectIdRequired
public readonly ciConcurrentProjectId: string;
  • Type: string

Unique ID of build execution in a single executor and project.

Added in GitLab all Available in GitLab Runner 11.10


ciConfigPathRequired
public readonly ciConfigPath: string;
  • Type: string

The path to CI configuration file. Defaults to .gitlab-ci.yml.

Added in GitLab 9.4 Available in GitLab Runner 0.5


ciDebugTraceRequired
public readonly ciDebugTrace: string;
  • Type: string

Whether debug logging (tracing) is enabled.

Added in GitLab all Available in GitLab Runner 1.7


ciDefaultBranchRequired
public readonly ciDefaultBranch: string;
  • Type: string

The name of the default branch for the project.

Added in GitLab 12.4 Available in GitLab Runner all


ciDependencyProxyGroupImagePrefixRequired
public readonly ciDependencyProxyGroupImagePrefix: string;
  • Type: string

The image prefix for pulling images through the Dependency Proxy.

Added in GitLab 13.7 Available in GitLab Runner all


ciDependencyProxyPasswordRequired
public readonly ciDependencyProxyPassword: string;
  • Type: string

The password to use to pull images through the Dependency Proxy.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab 13.7 Available in GitLab Runner all


ciDependencyProxyServerRequired
public readonly ciDependencyProxyServer: string;
  • Type: string

The server for logging in to the Dependency Proxy. This is equivalent to $CI_SERVER_HOST:$CI_SERVER_PORT.

Added in GitLab 13.7 Available in GitLab Runner all


ciDependencyProxyUserRequired
public readonly ciDependencyProxyUser: string;
  • Type: string

The username to use to pull images through the Dependency Proxy.

Added in GitLab 13.7 Available in GitLab Runner all


ciDeployPasswordRequired
public readonly ciDeployPassword: string;
  • Type: string

Authentication password of the GitLab Deploy Token, only present if the Project has one related.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab 10.8 Available in GitLab Runner all


ciDeployUserRequired
public readonly ciDeployUser: string;
  • Type: string

Authentication username of the GitLab Deploy Token, only present if the Project has one related.

Added in GitLab 10.8 Available in GitLab Runner all


ciJobIdRequired
public readonly ciJobId: string;
  • Type: string

The unique ID of the current job that GitLab CI/CD uses internally.

Added in GitLab 9.0 Available in GitLab Runner all


ciJobImageRequired
public readonly ciJobImage: string;
  • Type: string

The name of the image running the CI job.

Added in GitLab 12.9 Available in GitLab Runner 12.9


ciJobJwtRequired
public readonly ciJobJwt: string;
  • Type: string

RS256 JSON web token that can be used for authenticating with third party systems that support JWT authentication, for example HashiCorp’s Vault.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab 12.10 Available in GitLab Runner all


ciJobManualRequired
public readonly ciJobManual: string;
  • Type: string

The flag to indicate that job was manually started.

Added in GitLab 8.12 Available in GitLab Runner all


ciJobNameRequired
public readonly ciJobName: string;
  • Type: string

The name of the job as defined in .gitlab-ci.yml.

Added in GitLab 9.0 Available in GitLab Runner 0.5


ciJobStageRequired
public readonly ciJobStage: string;
  • Type: string

The name of the stage as defined in .gitlab-ci.yml.

Added in GitLab 9.0 Available in GitLab Runner 0.5


ciJobStatusRequired
public readonly ciJobStatus: string;
  • Type: string

The state of the job as each runner stage is executed.

Use with after_script where CI_JOB_STATUS can be either success, failed or canceled.

Added in GitLab all Available in GitLab Runner 13.5


ciJobTokenRequired
public readonly ciJobToken: string;
  • Type: string

Token used for authenticating with a few API endpoints and downloading dependent repositories.

The token is valid as long as the job is running.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab 9.0 Available in GitLab Runner 1.2


ciJobUrlRequired
public readonly ciJobUrl: string;
  • Type: string

Job details URL.

Added in GitLab 11.1 Available in GitLab Runner 0.5


ciMergeRequestTargetBranchNameRequired
public readonly ciMergeRequestTargetBranchName: string;
  • Type: string

The target branch name of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestTargetBranchShaRequired
public readonly ciMergeRequestTargetBranchSha: string;
  • Type: string

The HEAD SHA of the target branch of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used, the merge request is created, and the pipeline is a merged result pipeline.

Added in GitLab 11.9 Available in GitLab Runner all


ciNodeTotalRequired
public readonly ciNodeTotal: string;
  • Type: string

Total number of instances of this job running in parallel.

If the job is not parallelized, this variable is set to 1.

Added in GitLab 11.5 Available in GitLab Runner all


ciPagesDomainRequired
public readonly ciPagesDomain: string;
  • Type: string

The configured domain that hosts GitLab Pages.

Added in GitLab 11.8 Available in GitLab Runner all


ciPagesUrlRequired
public readonly ciPagesUrl: string;
  • Type: string

URL to GitLab Pages-built pages. Always belongs to a subdomain of CI_PAGES_DOMAIN.

Added in GitLab 11.8 Available in GitLab Runner all


ciPipelineIdRequired
public readonly ciPipelineId: string;
  • Type: string

The instance-level ID of the current pipeline. This is a unique ID across all projects on GitLab.

Added in GitLab 8.10 Available in GitLab Runner all


ciPipelineIidRequired
public readonly ciPipelineIid: string;
  • Type: string

The project-level IID (internal ID) of the current pipeline. This ID is unique for the current project.

Added in GitLab 11.0 Available in GitLab Runner all


ciPipelineSourceRequired
public readonly ciPipelineSource: string;
  • Type: string

Indicates how the pipeline was triggered.

Possible options are push, web, schedule, api, external, chat, webide, merge_request_event, external_pull_request_event, parent_pipeline, trigger, or pipeline. For pipelines created before GitLab 9.5, this is displayed as unknown.

Added in GitLab 10.0 Available in GitLab Runner all


ciPipelineTriggeredRequired
public readonly ciPipelineTriggered: string;
  • Type: string

The flag to indicate that job was triggered.

Added in GitLab all Available in GitLab Runner all


ciPipelineUrlRequired
public readonly ciPipelineUrl: string;
  • Type: string

Pipeline details URL.

Added in GitLab 11.1 Available in GitLab Runner 0.5


ciProjectConfigPathRequired
public readonly ciProjectConfigPath: string;
  • Type: string

The CI configuration path for the project.

Added in GitLab 13.8 Available in GitLab Runner all


ciProjectDirRequired
public readonly ciProjectDir: string;
  • Type: string

The full path where the repository is cloned and where the job is run.

If the GitLab Runner builds_dir parameter is set, this variable is set relative to the value of builds_dir. For more information, see Advanced configuration for GitLab Runner.

Added in GitLab all Available in GitLab Runner all


ciProjectIdRequired
public readonly ciProjectId: string;
  • Type: string

The unique ID of the current project that GitLab CI/CD uses internally.

Added in GitLab all Available in GitLab Runner all


ciProjectNameRequired
public readonly ciProjectName: string;
  • Type: string

The name of the directory for the project that is being built.

For example, if the project URL is gitlab.example.com/group-name/project-1, the CI_PROJECT_NAME would be project-1.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciProjectNamespaceRequired
public readonly ciProjectNamespace: string;
  • Type: string

The project stage (username or group name) that is being built.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciProjectPathRequired
public readonly ciProjectPath: string;
  • Type: string

The stage with project name.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciProjectPathSlugRequired
public readonly ciProjectPathSlug: string;
  • Type: string

$CI_PROJECT_PATH in lowercase and with everything except 0-9 and a-z replaced with -. Use in URLs and domain names.

Added in GitLab 9.3 Available in GitLab Runner all


ciProjectRepositoryLanguagesRequired
public readonly ciProjectRepositoryLanguages: string;
  • Type: string

Comma-separated, lowercase list of the languages used in the repository (for example ruby,javascript,html,css).

Added in GitLab 12.3 Available in GitLab Runner all


ciProjectRootNamespaceRequired
public readonly ciProjectRootNamespace: string;
  • Type: string

The root project stage (username or group name) that is being built.

For example, if CI_PROJECT_NAMESPACE is root-group/child-group/grandchild-group, CI_PROJECT_ROOT_NAMESPACE would be root-group.

Added in GitLab 13.2 Available in GitLab Runner 0.5


ciProjectTitleRequired
public readonly ciProjectTitle: string;
  • Type: string

The human-readable project name as displayed in the GitLab web interface.

Added in GitLab 12.4 Available in GitLab Runner all


ciProjectUrlRequired
public readonly ciProjectUrl: string;
  • Type: string

The HTTP(S) address to access project.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciProjectVisibilityRequired
public readonly ciProjectVisibility: string;
  • Type: string

The project visibility (internal, private, public).

Added in GitLab 10.3 Available in GitLab Runner all


ciRegistryPasswordRequired
public readonly ciRegistryPassword: string;
  • Type: string

The password to use to push containers to the GitLab Container Registry, for the current project.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab 9.0 Available in GitLab Runner all


ciRepositoryUrlRequired
public readonly ciRepositoryUrl: string;
  • Type: string

The URL to clone the Git repository.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab 9.0 Available in GitLab Runner all


ciRunnerDescriptionRequired
public readonly ciRunnerDescription: string;
  • Type: string

The description of the runner as saved in GitLab.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciRunnerExecutableArchRequired
public readonly ciRunnerExecutableArch: string;
  • Type: string

The OS/architecture of the GitLab Runner executable (note that this is not necessarily the same as the environment of the executor).

Added in GitLab all Available in GitLab Runner 10.6


ciRunnerIdRequired
public readonly ciRunnerId: string;
  • Type: string

The unique ID of runner being used.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciRunnerRevisionRequired
public readonly ciRunnerRevision: string;
  • Type: string

GitLab Runner revision that is executing the current job.

Added in GitLab all Available in GitLab Runner 10.6


ciRunnerShortTokenRequired
public readonly ciRunnerShortToken: string;
  • Type: string

First eight characters of the runner’s token used to authenticate new job requests. Used as the runner’s unique ID.

ATTENTION: Contrary to most other variables in this class, this variable is not resolved at rendering time. Instead the variable string is returned, which is then resolved during pipeline execution. This is because the value contains sensitive information.

Added in GitLab all Available in GitLab Runner 12.3


ciRunnerTagsRequired
public readonly ciRunnerTags: string;
  • Type: string

The defined runner tags.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciRunnerVersionRequired
public readonly ciRunnerVersion: string;
  • Type: string

GitLab Runner version that is executing the current job.

Added in GitLab all Available in GitLab Runner 10.6


ciServerRequired
public readonly ciServer: string;
  • Type: string

Mark that job is executed in CI environment.

Added in GitLab all Available in GitLab Runner all


ciServerHostRequired
public readonly ciServerHost: string;
  • Type: string

Host component of the GitLab instance URL, without protocol and port (like gitlab.example.com).

Added in GitLab 12.1 Available in GitLab Runner all


ciServerNameRequired
public readonly ciServerName: string;
  • Type: string

The name of CI server that is used to coordinate jobs.

Added in GitLab all Available in GitLab Runner all


ciServerPortRequired
public readonly ciServerPort: string;
  • Type: string

Port component of the GitLab instance URL, without host and protocol (like 3000).

Added in GitLab 12.8 Available in GitLab Runner all


ciServerProtocolRequired
public readonly ciServerProtocol: string;
  • Type: string

Protocol component of the GitLab instance URL, without host and port (like https).

Added in GitLab 12.8 Available in GitLab Runner all


ciServerRevisionRequired
public readonly ciServerRevision: string;
  • Type: string

GitLab revision that is used to schedule jobs.

Added in GitLab all Available in GitLab Runner all


ciServerUrlRequired
public readonly ciServerUrl: string;
  • Type: string

The base URL of the GitLab instance, including protocol and port (like https://gitlab.example.com:8080).

Added in GitLab 12.7 Available in GitLab Runner all


ciServerVersionRequired
public readonly ciServerVersion: string;
  • Type: string

GitLab version that is used to schedule jobs.

Added in GitLab all Available in GitLab Runner all


ciServerVersionMajorRequired
public readonly ciServerVersionMajor: string;
  • Type: string

GitLab version major component.

Added in GitLab 11.4 Available in GitLab Runner all


ciServerVersionMinorRequired
public readonly ciServerVersionMinor: string;
  • Type: string

GitLab version minor component.

Added in GitLab 11.4 Available in GitLab Runner all


ciServerVersionPatchRequired
public readonly ciServerVersionPatch: string;
  • Type: string

GitLab version patch component.

Added in GitLab 11.4 Available in GitLab Runner all


gitlabCiRequired
public readonly gitlabCi: string;
  • Type: string

Mark that job is executed in GitLab CI/CD environment.

Added in GitLab all Available in GitLab Runner all


gitlabFeaturesRequired
public readonly gitlabFeatures: string;
  • Type: string

The comma separated list of licensed features available for your instance and plan.

Added in GitLab 10.6 Available in GitLab Runner all


gitlabUserEmailRequired
public readonly gitlabUserEmail: string;
  • Type: string

The email of the user who started the job.

Added in GitLab 8.12 Available in GitLab Runner all


gitlabUserIdRequired
public readonly gitlabUserId: string;
  • Type: string

The ID of the user who started the job.

Added in GitLab 8.12 Available in GitLab Runner all


gitlabUserLoginRequired
public readonly gitlabUserLogin: string;
  • Type: string

The login username of the user who started the job.

Added in GitLab 10.0 Available in GitLab Runner all


gitlabUserNameRequired
public readonly gitlabUserName: string;
  • Type: string

The real name of the user who started the job.

Added in GitLab 10.0 Available in GitLab Runner all


ciCommitBranchOptional
public readonly ciCommitBranch: string;
  • Type: string

The commit branch name.

Present in branch pipelines, including pipelines for the default branch. Not present in merge request pipelines or tag pipelines.

Added in GitLab 12.6 Available in GitLab Runner 0.5


ciCommitTagOptional
public readonly ciCommitTag: string;
  • Type: string

The commit tag name. Present only when building tags.

Added in GitLab 9.0 Available in GitLab Runner 0.5


ciDeployFreezeOptional
public readonly ciDeployFreeze: string;
  • Type: string

Included with the value true if the pipeline runs during a deploy freeze window.

Added in GitLab 13.2 Available in GitLab Runner all


ciDisposableEnvironmentOptional
public readonly ciDisposableEnvironment: string;
  • Type: string

Marks that the job is executed in a disposable environment (something that is created only for this job and disposed of/destroyed after the execution - all executors except shell and ssh).

If the environment is disposable, it is set to true, otherwise it is not defined at all.

Added in GitLab all Available in GitLab Runner 10.1


ciEnvironmentNameOptional
public readonly ciEnvironmentName: string;
  • Type: string

The name of the environment for this job. Only present if environment:name is set.

Added in GitLab 8.15 Available in GitLab Runner all


ciEnvironmentSlugOptional
public readonly ciEnvironmentSlug: string;
  • Type: string

A simplified version of the environment name, suitable for inclusion in DNS, URLs, Kubernetes labels, and so on.

Only present if environment:name is set.

Added in GitLab 8.15 Available in GitLab Runner all


ciEnvironmentUrlOptional
public readonly ciEnvironmentUrl: string;
  • Type: string

The URL of the environment for this job. Only present if environment:url is set.

Added in GitLab 9.3 Available in GitLab Runner all


ciExternalPullRequestIidOptional
public readonly ciExternalPullRequestIid: string;
  • Type: string

Pull Request ID from GitHub if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open.

Added in GitLab 12.3 Available in GitLab Runner all


ciExternalPullRequestSourceBranchNameOptional
public readonly ciExternalPullRequestSourceBranchName: string;
  • Type: string

The source branch name of the pull request if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open.

Added in GitLab 12.3 Available in GitLab Runner all


ciExternalPullRequestSourceBranchShaOptional
public readonly ciExternalPullRequestSourceBranchSha: string;
  • Type: string

The HEAD SHA of the source branch of the pull request if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open.

Added in GitLab 12.3 Available in GitLab Runner all


ciExternalPullRequestSourceRepositoryOptional
public readonly ciExternalPullRequestSourceRepository: string;
  • Type: string

The source repository name of the pull request if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open.

Added in GitLab 13.3 Available in GitLab Runner all


ciExternalPullRequestTargetBranchNameOptional
public readonly ciExternalPullRequestTargetBranchName: string;
  • Type: string

The target branch name of the pull request if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open. * Added in GitLab 12.3 Available in GitLab Runner all


ciExternalPullRequestTargetBranchShaOptional
public readonly ciExternalPullRequestTargetBranchSha: string;
  • Type: string

The HEAD SHA of the target branch of the pull request if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open.

Added in GitLab 12.3 Available in GitLab Runner all


ciExternalPullRequestTargetRepositoryOptional
public readonly ciExternalPullRequestTargetRepository: string;
  • Type: string

The target repository name of the pull request if the pipelines are for external pull requests.

Available only if only [external_pull_requests] or rules syntax is used and the pull request is open.

Added in GitLab 13.3 Available in GitLab Runner all


ciHasOpenRequirementsOptional
public readonly ciHasOpenRequirements: string;
  • Type: string

Included with the value true only if the pipeline’s project has any open requirements.

Not included if there are no open requirements for the pipeline’s project.

Added in GitLab 13.1 Available in GitLab Runner all


ciKubernetesActiveOptional
public readonly ciKubernetesActive: string;
  • Type: string

Included with the value true only if the pipeline has a Kubernetes cluster available for deployments.

Not included if no cluster is available. Can be used as an alternative to only:kubernetes/except:kubernetes with rules:if.

Added in GitLab 13.0 Available in GitLab Runner all


ciMergeRequestAssigneesOptional
public readonly ciMergeRequestAssignees: string;
  • Type: string

Comma-separated list of username(s) of assignee(s) for the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.9 Available in GitLab Runner all


ciMergeRequestDiffBaseShaOptional
public readonly ciMergeRequestDiffBaseSha: string;
  • Type: string

The base SHA of the merge request diff, if the pipelines are for merge requests.

Added in GitLab 13.7 Available in GitLab Runner all


ciMergeRequestDiffIdOptional
public readonly ciMergeRequestDiffId: string;
  • Type: string

The version of the merge request diff, if the pipelines are for merge requests.

Added in GitLab 13.7 Available in GitLab Runner all


ciMergeRequestEventTypeOptional
public readonly ciMergeRequestEventType: string;
  • Type: string

The event type of the merge request, if the pipelines are for merge requests. Can be detached, merged_result or merge_train.

Added in GitLab 12.3 Available in GitLab Runner all


ciMergeRequestIdOptional
public readonly ciMergeRequestId: string;
  • Type: string

The instance-level ID of the merge request.

Only available if the pipelines are for merge requests and the merge request is created. This is a unique ID across all projects on GitLab.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestIidOptional
public readonly ciMergeRequestIid: string;
  • Type: string

The project-level IID (internal ID) of the merge request.

Only available If the pipelines are for merge requests and the merge request is created. This ID is unique for the current project.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestLabelsOptional
public readonly ciMergeRequestLabels: string;
  • Type: string

Comma-separated label names of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.9 Available in GitLab Runner all


ciMergeRequestMilestoneOptional
public readonly ciMergeRequestMilestone: string;
  • Type: string

The milestone title of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.9 Available in GitLab Runner all


ciMergeRequestProjectIdOptional
public readonly ciMergeRequestProjectId: string;
  • Type: string

The ID of the project of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestProjectPathOptional
public readonly ciMergeRequestProjectPath: string;
  • Type: string

The path of the project of the merge request if the pipelines are for merge requests (for example stage/awesome-project).

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestProjectUrlOptional
public readonly ciMergeRequestProjectUrl: string;
  • Type: string

The URL of the project of the merge request if the pipelines are for merge requests (for example http://192.168.10.15:3000/stage/awesome-project). Available only if only [merge_requests] or rules syntax is used and the merge request is created. * Added in GitLab 11.6 Available in GitLab Runner all.


ciMergeRequestRefPathOptional
public readonly ciMergeRequestRefPath: string;
  • Type: string

The ref path of the merge request if the pipelines are for merge requests.

(for example refs/merge-requests/1/head). Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestSourceBranchNameOptional
public readonly ciMergeRequestSourceBranchName: string;
  • Type: string

The source branch name of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestSourceBranchShaOptional
public readonly ciMergeRequestSourceBranchSha: string;
  • Type: string

The HEAD SHA of the source branch of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used, the merge request is created, and the pipeline is a merged result pipeline.

Added in GitLab 11.9 Available in GitLab Runner all


ciMergeRequestSourceProjectIdOptional
public readonly ciMergeRequestSourceProjectId: string;
  • Type: string

The ID of the source project of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestSourceProjectPathOptional
public readonly ciMergeRequestSourceProjectPath: string;
  • Type: string

The path of the source project of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestSourceProjectUrlOptional
public readonly ciMergeRequestSourceProjectUrl: string;
  • Type: string

The URL of the source project of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.6 Available in GitLab Runner all


ciMergeRequestTitleOptional
public readonly ciMergeRequestTitle: string;
  • Type: string

The title of the merge request if the pipelines are for merge requests.

Available only if only [merge_requests] or rules syntax is used and the merge request is created.

Added in GitLab 11.9 Available in GitLab Runner all


ciNodeIndexOptional
public readonly ciNodeIndex: string;
  • Type: string

Index of the job in the job set. If the job is not parallelized, this variable is not set.

Added in GitLab 11.5 Available in GitLab Runner all


ciOpenMergeRequestsOptional
public readonly ciOpenMergeRequests: string;
  • Type: string

Available in branch and merge request pipelines.

Contains a comma-separated list of up to four merge requests that use the current branch and project as the merge request source. For example gitlab-org/gitlab!333,gitlab-org/gitlab-foss!11.

Added in GitLab 13.8 Available in GitLab Runner all


ciRegistryOptional
public readonly ciRegistry: string;
  • Type: string

GitLab Container Registry. This variable includes a :port value if one has been specified in the registry configuration.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciRegistryImageOptional
public readonly ciRegistryImage: string;
  • Type: string

the address of the registry tied to the specific project.

Added in GitLab 8.10 Available in GitLab Runner 0.5


ciRegistryUserOptional
public readonly ciRegistryUser: string;
  • Type: string

The username to use to push containers to the GitLab Container Registry, for the current project.

Added in GitLab 9.0 Available in GitLab Runner all


ciSharedEnvironmentOptional
public readonly ciSharedEnvironment: string;
  • Type: string

Marks that the job is executed in a shared environment (something that is persisted across CI invocations like shell or ssh executor).

If the environment is shared, it is set to true, otherwise it is not defined at all.

Added in GitLab all Available in GitLab Runner 10.1


triggerPayloadOptional
public readonly triggerPayload: string;
  • Type: string

This variable is available when a pipeline is triggered with a webhook.

Added in GitLab 13.9 Available in GitLab Runner all


Rule

Initializers

1
2
3
import { Rule } from '@gcix/gcix'

new Rule(props: RuleProps)
Name Type Description
props RuleProps No description.

propsRequired

Methods

Name Description
addVariables Adds one or more variables, each as keyword argument, to the rule.
isEqual isEqual checks if this object is equal to given object.
never This method is intended to be used for predefined rules.
render Returns a representation of any object which implements IBase.

addVariables
public addVariables(variables: {[ key: string ]: string}): Rule

Adds one or more variables, each as keyword argument, to the rule.

rule.addVariables({GREETING: "hello", LANGUAGE: "typescript"})
variablesRequired
  • Type: {[ key: string ]: string}

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

never
public never(): Rule

This method is intended to be used for predefined rules.

For instance you have defined an often used rule on_master whose if statement checks if the pipeline is executed on branch master. Then you can either run a job, if on master...

myJob.appendRules(onMaster)

... or do not run a job if on master...

myJob.appendRules(onMaster.never())
render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
variables {[ key: string ]: string} No description.
allowFailure boolean No description.
changes string[] No description.
exists string[] No description.
ifStatement string No description.
when WhenStatement No description.

variablesRequired
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

allowFailureOptional
public readonly allowFailure: boolean;
  • Type: boolean

changesOptional
public readonly changes: string[];
  • Type: string[]

existsOptional
public readonly exists: string[];
  • Type: string[]

ifStatementOptional
public readonly ifStatement: string;
  • Type: string

whenOptional
public readonly when: WhenStatement;

RuleLib

Represents a library of static methods to create rules for GitLab CI/CD pipeline conditions.

Static Functions

Name Description
notOnBranch Creates a rule that evaluates to true if the CI/CD pipeline is NOT running on the specified branch.
notOnMain Creates a rule that evaluates to true if the CI/CD pipeline is NOT running on the "main" branch.
notOnMaster Creates a rule that evaluates to true if the CI/CD pipeline is NOT running on the "master" branch.
onBranch Creates a rule that evaluates to true if the CI/CD pipeline is running on the specified branch.
onMain Creates a rule that evaluates to true if the CI/CD pipeline is running on the "main" branch.
onMaster Creates a rule that evaluates to true if the CI/CD pipeline is running on the "master" branch.
onMergeRequestEvents Creates a rule that evaluates to true for merge request events in the CI/CD pipeline.
onPipelineTrigger Creates a rule that evaluates to true for pipelines triggered by API or the trigger keyword.
onSuccess Creates a rule that always evaluates to true (success).
onTags Creates a rule that evaluates to true for CI/CD pipelines triggered by tags.

notOnBranch
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.notOnBranch(branchName: string)

Creates a rule that evaluates to true if the CI/CD pipeline is NOT running on the specified branch.

branchNameRequired
  • Type: string

The name of the branch to check.


notOnMain
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.notOnMain()

Creates a rule that evaluates to true if the CI/CD pipeline is NOT running on the "main" branch.

notOnMaster
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.notOnMaster()

Creates a rule that evaluates to true if the CI/CD pipeline is NOT running on the "master" branch.

onBranch
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onBranch(branchName: string)

Creates a rule that evaluates to true if the CI/CD pipeline is running on the specified branch.

branchNameRequired
  • Type: string

The name of the branch to check.


onMain
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onMain()

Creates a rule that evaluates to true if the CI/CD pipeline is running on the "main" branch.

onMaster
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onMaster()

Creates a rule that evaluates to true if the CI/CD pipeline is running on the "master" branch.

onMergeRequestEvents
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onMergeRequestEvents()

Creates a rule that evaluates to true for merge request events in the CI/CD pipeline.

onPipelineTrigger
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onPipelineTrigger()

Creates a rule that evaluates to true for pipelines triggered by API or the trigger keyword.

onSuccess
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onSuccess()

Creates a rule that always evaluates to true (success).

onTags
1
2
3
import { RuleLib } from '@gcix/gcix'

RuleLib.onTags()

Creates a rule that evaluates to true for CI/CD pipelines triggered by tags.

Service

Initializers

1
2
3
import { Service } from '@gcix/gcix'

new Service(props: ServiceProps)
Name Type Description
props ServiceProps No description.

propsRequired

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
name string No description.

nameRequired
public readonly name: string;
  • Type: string

TriggerJob

This class represents the trigger job.

Jobs with trigger can only use a limited set of keywords. For example, you can’t run commands with script.

Simple example:

1
2
3
4
5
6
7
const triggerJob = new TriggerJob({
    stage: "trigger-other-job",
    project: "myteam/other-project",
    branch: "main",
    strategy: "depend",
})
triggerJob.appendRules(rules.onTags().never(), rules.onMain())

Initializers

1
2
3
import { TriggerJob } from '@gcix/gcix'

new TriggerJob(props: TriggerJobProps)
Name Type Description
props TriggerJobProps No description.

propsRequired

Methods

Name Description
addDependencies No description.
addNeeds No description.
addParent This method is called by gcix.JobCollections when the job is added to that JobCollection.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignAllowFailure No description.
assignArtifacts No description.
assignCache No description.
assignDependencies No description.
assignImage Sets the image of this job.
assignNeeds No description.
assignTags No description.
copy Returns an independent, deep copy object of this job.
extendName This method is used by gcix.JobCollections to populate the jobs name.
extendStage This method is used by gcix.JobCollections to populate the jobs name and stage.
extendStageValue This method is used by gcix.JobCollections to populate the jobs stage.
getAllInstanceNames Return all instance names from the given child.
isEqual isEqual checks if this object is equal to given object.
prependRules No description.
prependScripts No description.
render Returns a representation of any object which implements IBase.

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

addParent
public addParent(parent: Job | JobCollection): void

This method is called by gcix.JobCollections when the job is added to that JobCollection.

The job needs to know its parents when getAllInstanceNames() is called.

parentRequired

addTags
public addTags(tags: string[]): Job
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): Job
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): Job
rulesRequired

appendScripts
public appendScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

assignAllowFailure
public assignAllowFailure(allowFailure: boolean | number[]): Job
allowFailureRequired
  • Type: boolean | number[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): Job
artifactsRequired

assignCache
public assignCache(cache: Cache): Job
cacheRequired

assignDependencies
public assignDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

assignImage
public assignImage(image: string | Image): Job

Sets the image of this job.

For a simple container image you can provide the origin of the image. If you want to set the entrypoint, you have to provide an Image object instead.

!! Any previous values will be overwritten.

imageRequired

assignNeeds
public assignNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

assignTags
public assignTags(tags: string[]): Job
tagsRequired
  • Type: string[]

copy
public copy(): Job

Returns an independent, deep copy object of this job.

extendName
public extendName(name: string): void

This method is used by gcix.JobCollections to populate the jobs name.

nameRequired
  • Type: string

extendStage
public extendStage(stage: string): void

This method is used by gcix.JobCollections to populate the jobs name and stage.

stageRequired
  • Type: string

extendStageValue
public extendStageValue(stage: string): void

This method is used by gcix.JobCollections to populate the jobs stage.

stageRequired
  • Type: string

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this sequence and all parent sequences.

childOptional

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

prependRules
public prependRules(rules: Rule[]): Job
rulesRequired

prependScripts
public prependScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

Properties

Name Type Description
tags string[] Getter method to receive added tags.
allowFailure string | boolean | number[] No description.
name string No description.
orderedTags OrderedStringSet No description.
parents Job | JobCollection[] No description.
scripts string[] No description.
stage string No description.
artifacts Artifacts No description.
cache Cache No description.
dependencies Job | JobCollection | Need[] No description.
image Image No description.
needs Job | JobCollection | Need[] No description.
original Job No description.
rules Rule[] No description.
variables {[ key: string ]: string} No description.
branch string The branch of project the pipeline should be triggered of.
includes IncludeLocal | IncludeFile | IncludeRemote | IncludeTemplate | IncludeArtifact[] Include a pipeline to trigger (Parent-child pipeline trigger) Mutually exclusiv with project.
project string The full name of another Gitlab project to trigger (multi-project pipeline trigger).
strategy string Determines if the result of this pipeline depends on the triggered downstream pipeline (use TriggerStrategy.DEPEND) or if just "fire and forget" the downstream pipeline (use None).

tagsRequired
public readonly tags: string[];
  • Type: string[]

Getter method to receive added tags.


allowFailureRequired
public readonly allowFailure: string | boolean | number[];
  • Type: string | boolean | number[]

nameRequired
public readonly name: string;
  • Type: string

orderedTagsRequired
public readonly orderedTags: OrderedStringSet;

parentsRequired
public readonly parents: Job | JobCollection[];

scriptsRequired
public readonly scripts: string[];
  • Type: string[]

stageRequired
public readonly stage: string;
  • Type: string

artifactsOptional
public readonly artifacts: Artifacts;

cacheOptional
public readonly cache: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];

imageOptional
public readonly image: Image;

needsOptional
public readonly needs: Job | JobCollection | Need[];

originalOptional
public readonly original: Job;

rulesOptional
public readonly rules: Rule[];

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

branchOptional
public readonly branch: string;
  • Type: string

The branch of project the pipeline should be triggered of.


includesOptional
public readonly includes: IncludeLocal | IncludeFile | IncludeRemote | IncludeTemplate | IncludeArtifact[];

Include a pipeline to trigger (Parent-child pipeline trigger) Mutually exclusiv with project.


projectOptional
public readonly project: string;
  • Type: string

The full name of another Gitlab project to trigger (multi-project pipeline trigger).

Mutually exclusive with includes.


strategyOptional
public readonly strategy: string;
  • Type: string

Determines if the result of this pipeline depends on the triggered downstream pipeline (use TriggerStrategy.DEPEND) or if just "fire and forget" the downstream pipeline (use None).


Protocols

IArtifacts

Methods

Name Description
addExcludes No description.
addPaths No description.

addExcludes
public addExcludes(excludes: string[]): void
excludesRequired
  • Type: string[]

addPaths
public addPaths(paths: string[]): void
pathsRequired
  • Type: string[]

Properties

Name Type Description
excludes string[] No description.
paths string[] No description.
expireIn string No description.
exposeAs string No description.
name string No description.
public boolean No description.
reports ArtifactsReport[] No description.
untracked boolean No description.
when WhenStatement No description.

excludesRequired
public readonly excludes: string[];
  • Type: string[]

pathsRequired
public readonly paths: string[];
  • Type: string[]

expireInOptional
public readonly expireIn: string;
  • Type: string

exposeAsOptional
public readonly exposeAs: string;
  • Type: string

nameOptional
public readonly name: string;
  • Type: string

publicOptional
public readonly public: boolean;
  • Type: boolean

reportsOptional
public readonly reports: ArtifactsReport[];

untrackedOptional
public readonly untracked: boolean;
  • Type: boolean

whenOptional
public readonly when: WhenStatement;

IBase

Methods

Name Description
isEqual isEqual checks if this object is equal to given object.
render Returns a representation of any object which implements IBase.

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired

An arbitrary object to compare to.


render
public render(): any

Returns a representation of any object which implements IBase.

The rendered representation is used by the gcix to dump it in YAML format as part of the .gitlab-ci.yml pipeline.

ICache

ICacheKey

IImage

Methods

Name Description
withEntrypoint No description.
withTag No description.

withEntrypoint
public withEntrypoint(entrypoint: string[]): Image
entrypointRequired
  • Type: string[]

withTag
public withTag(tag: string): Image
tagRequired
  • Type: string

IInclude

This module represents the Gitlab CI Include keyword.

Use include to include external YAML files in your CI/CD configuration.

include:local example:

pipeline.addInclude(new IncludeLocal({local: "/templates/.gitlab-ci-template.yml"}))
include:file example:
1
2
3
4
5
pipeline.addInclude(new IncludeFile({
        project="my-group/my-project",
        ref="master",
        file="/templates/.gitlab-ci-template.yml"
    }))

include:remote example:

1
2
3
pipeline.addInclude(new IncludeRemote({
         remote: "https://gitlab.com/example-project/-/raw/master/.gitlab-ci.yml"
     }))

include:template example:

pipeline.addInclude(new IncludeTemplate({template: "Auto-DevOps.gitlab-ci.yml"}))

Special type of include: Use a gcix.TriggerJob with IncludeArtifact to run a child pipeline with a generated configuration file from a previous job:

new TriggerJob({includes=[IncludeArtifact(job="generate-config", artifact="generated-config.yml")]})

IIncludeArtifact

IIncludeFile

IIncludeLocal

IIncludeRemote

IIncludeTemplate

IJob

  • Extends: IJobBase

  • Implemented By: @gcix/gcix.aws.CdkBootstrap, @gcix/gcix.aws.CdkDeploy, @gcix/gcix.aws.CdkDiff, @gcix/gcix.aws.CdkMirrorToCodecommit, @gcix/gcix.container.CraneCopy, @gcix/gcix.container.CranePull, @gcix/gcix.container.CranePush, @gcix/gcix.container.DiveScan, @gcix/gcix.container.DockerBuild, @gcix/gcix.container.DockerPush, @gcix/gcix.container.KanikoExecute, @gcix/gcix.container.TrivyIgnoreFileCheck, @gcix/gcix.container.TrivyScanLocalImage, @gcix/gcix.git.GitMirror, @gcix/gcix.gitlab.PagesAsciiDoctor, @gcix/gcix.python.PagesPdoc3, @gcix/gcix.python.PagesSphinx, @gcix/gcix.python.PythonBuildBdistWheel, @gcix/gcix.python.PythonDeployTwineUpload, @gcix/gcix.python.PythonLintFlake8, @gcix/gcix.python.PythonLintIsort, @gcix/gcix.python.PythonLintMyPy, @gcix/gcix.python.PythonTestEvaluateGitTagPep440Conformity, @gcix/gcix.python.PythonTestPytest, Job, PagesJob, TriggerJob, IJob

Methods

Name Description
addParent This method is called by gcix.JobCollections when the job is added to that JobCollection.
assignAllowFailure No description.
assignDependencies No description.
assignImage Sets the image of this job.
assignNeeds No description.
assignTags No description.
copy Returns an independent, deep copy object of this job.
extendName This method is used by gcix.JobCollections to populate the jobs name.
extendStage This method is used by gcix.JobCollections to populate the jobs name and stage.
extendStageValue This method is used by gcix.JobCollections to populate the jobs stage.

addParent
public addParent(parent: Job | JobCollection): void

This method is called by gcix.JobCollections when the job is added to that JobCollection.

The job needs to know its parents when getAllInstanceNames() is called.

parentRequired

any type of Job or JobCollection.


assignAllowFailure
public assignAllowFailure(allowFailure: boolean | number[]): Job
allowFailureRequired
  • Type: boolean | number[]

assignDependencies
public assignDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

assignImage
public assignImage(image: string | Image): Job

Sets the image of this job.

For a simple container image you can provide the origin of the image. If you want to set the entrypoint, you have to provide an Image object instead.

!! Any previous values will be overwritten.

imageRequired

assignNeeds
public assignNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

assignTags
public assignTags(tags: string[]): Job
tagsRequired
  • Type: string[]

copy
public copy(): Job

Returns an independent, deep copy object of this job.

extendName
public extendName(name: string): void

This method is used by gcix.JobCollections to populate the jobs name.

nameRequired
  • Type: string

to append to the current name.


extendStage
public extendStage(stage: string): void

This method is used by gcix.JobCollections to populate the jobs name and stage.

stageRequired
  • Type: string

name to extend the stage and the name.


extendStageValue
public extendStageValue(stage: string): void

This method is used by gcix.JobCollections to populate the jobs stage.

stageRequired
  • Type: string

name to extend the stage.


Properties

Name Type Description
tags string[] Getter method to receive added tags.
original Job No description.

tagsRequired
public readonly tags: string[];
  • Type: string[]

Getter method to receive added tags.


originalOptional
public readonly original: Job;

IJobBase

  • Extends: IBase

  • Implemented By: @gcix/gcix.aws.CdkBootstrap, @gcix/gcix.aws.CdkDeploy, @gcix/gcix.aws.CdkDiff, @gcix/gcix.aws.CdkMirrorToCodecommit, @gcix/gcix.container.CraneCopy, @gcix/gcix.container.CranePull, @gcix/gcix.container.CranePush, @gcix/gcix.container.DiveScan, @gcix/gcix.container.DockerBuild, @gcix/gcix.container.DockerPush, @gcix/gcix.container.KanikoExecute, @gcix/gcix.container.TrivyIgnoreFileCheck, @gcix/gcix.container.TrivyScanLocalImage, @gcix/gcix.git.GitMirror, @gcix/gcix.gitlab.PagesAsciiDoctor, @gcix/gcix.python.PagesPdoc3, @gcix/gcix.python.PagesSphinx, @gcix/gcix.python.PythonBuildBdistWheel, @gcix/gcix.python.PythonDeployTwineUpload, @gcix/gcix.python.PythonLintFlake8, @gcix/gcix.python.PythonLintIsort, @gcix/gcix.python.PythonLintMyPy, @gcix/gcix.python.PythonTestEvaluateGitTagPep440Conformity, @gcix/gcix.python.PythonTestPytest, Job, PagesJob, TriggerJob, IJob, IJobBase

Methods

Name Description
addDependencies No description.
addNeeds No description.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignArtifacts No description.
assignCache No description.
getAllInstanceNames Return all instance names from the given child.
prependRules No description.
prependScripts No description.

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired

addTags
public addTags(tags: string[]): Job
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): Job
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): Job
rulesRequired

appendScripts
public appendScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): Job
artifactsRequired

assignCache
public assignCache(cache: Cache): Job
cacheRequired

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this sequence and all parent sequences.

childOptional

prependRules
public prependRules(rules: Rule[]): Job
rulesRequired

prependScripts
public prependScripts(scripts: string[]): Job
scriptsRequired
  • Type: string[]

Properties

Name Type Description
tags string[] Getter method to receive added tags.

tagsRequired
public readonly tags: string[];
  • Type: string[]

Getter method to receive added tags.


IJobCollection

  • Extends: IJobCollectionBase

  • Implemented By: @gcix/gcix.aws.CdkDiffDeploy, @gcix/gcix.container.BuildContainerCollection, @gcix/gcix.container.BuildGitlabContainerCollection, @gcix/gcix.container.CopyContainerCollection, @gcix/gcix.python.PythonFullStack, JobCollection, Pipeline, IJobCollection

Methods

Name Description
addChildren Add gcix.Jobs or other gcix.JobCollections to this JobCollection.
addParent No description.
initializeAllowFailure Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection that haven't been set the allowFailure before.
initializeArtifacts Sets gcix.Job.artifacts to all jobs within this JobCollection that haven't been set the artifacs before.
initializeCache Calling gcix.Job.assigneCache() to all jobs within this JobCollection that haven't been set the cache before.
initializeDependencies Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection that haven't been added dependencies before.
initializeImage Calling gcix.Job.assignImage() to all jobs within this JobCollection.
initializeNeeds Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection that haven't been added needs before.
initializeRules Calling gcix.Job.append_rules() to all jobs within this JobCollection that haven't been added rules before.
initializeTags Calling gcix.Job.addTags([...]) to all jobs within this JobCollection that haven't been added tags before.
initializeVariables Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection that haven't been added variables before.
overrideAllowFailure Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection overriding any previous set value.
overrideDependencies Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection and overriding any previously added dependencies to that jobs.
overrideImage Calling gcix.Job.assignImage() to all jobs within this JobCollection overriding any previous set value.
overrideNeeds Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection and overriding any previously added needs to that jobs.
overrideRules Calling gcix.Job.overrideRules() to all jobs within this JobCollection and overriding any previously added rules to that jobs.
overrideTags Calling gcix.Job.addTags([...]) to all jobs within this JobCollection and overriding any previously added tags to that jobs.
overrideVariables Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection and overriding any previously added variables to that jobs.

addChildren
public addChildren(props: AddChildrenProps): JobCollection

Add gcix.Jobs or other gcix.JobCollections to this JobCollection.

Adding a child creates a copy of that child. You should provide a name or stage when adding children, to make them different from other places where they will be used.

propsRequired

addParent
public addParent(parent: JobCollection): void
parentRequired

initializeAllowFailure
public initializeAllowFailure(allowFailure: boolean | number[]): JobCollection

Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection that haven't been set the allowFailure before.

allowFailureRequired
  • Type: boolean | number[]

???


initializeArtifacts
public initializeArtifacts(artifacts: Artifacts): JobCollection

Sets gcix.Job.artifacts to all jobs within this JobCollection that haven't been set the artifacs before.

artifactsRequired

???


initializeCache
public initializeCache(cache: Cache): JobCollection

Calling gcix.Job.assigneCache() to all jobs within this JobCollection that haven't been set the cache before.

cacheRequired

???


initializeDependencies
public initializeDependencies(dependencies: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection that haven't been added dependencies before.

An empty parameter list means that jobs will get an empty dependency list and thus does not download artifacts by default.

dependenciesRequired

???


initializeImage
public initializeImage(image: string | Image): JobCollection

Calling gcix.Job.assignImage() to all jobs within this JobCollection.

imageRequired

???


initializeNeeds
public initializeNeeds(needs: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection that haven't been added needs before.

An empty parameter list means that jobs will get an empty dependency list and thus does not depend on other jobs by default.

needsRequired

???


initializeRules
public initializeRules(rules: Rule[]): JobCollection

Calling gcix.Job.append_rules() to all jobs within this JobCollection that haven't been added rules before.

rulesRequired

???


initializeTags
public initializeTags(tags: string[]): JobCollection

Calling gcix.Job.addTags([...]) to all jobs within this JobCollection that haven't been added tags before.

tagsRequired
  • Type: string[]

???


initializeVariables
public initializeVariables(variables: {[ key: string ]: string}): JobCollection

Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection that haven't been added variables before.

variablesRequired
  • Type: {[ key: string ]: string}

???


overrideAllowFailure
public overrideAllowFailure(allowFailure: boolean | number[]): JobCollection

Calling gcix.Job.assignAllowFailure() to all jobs within this JobCollection overriding any previous set value.

allowFailureRequired
  • Type: boolean | number[]

???


overrideDependencies
public overrideDependencies(dependencies: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignDependencies() to all jobs within the first stage of this JobCollection and overriding any previously added dependencies to that jobs.

An empty parameter list means that jobs will get an empty dependency list and thus does not download artifacts.

dependenciesRequired

???


overrideImage
public overrideImage(image: string | Image): JobCollection

Calling gcix.Job.assignImage() to all jobs within this JobCollection overriding any previous set value.

imageRequired

???


overrideNeeds
public overrideNeeds(needs: Job | JobCollection | Need[]): JobCollection

Calling gcix.Job.assignNeeds() to all jobs within the first stage of this JobCollection and overriding any previously added needs to that jobs.

An empty parameter list means that jobs will get an empty dependency list and thus does not depend on other jobs.

needsRequired

???


overrideRules
public overrideRules(rules: Rule[]): JobCollection

Calling gcix.Job.overrideRules() to all jobs within this JobCollection and overriding any previously added rules to that jobs.

rulesRequired

???


overrideTags
public overrideTags(tags: string[]): JobCollection

Calling gcix.Job.addTags([...]) to all jobs within this JobCollection and overriding any previously added tags to that jobs.

tagsRequired
  • Type: string[]

???


overrideVariables
public overrideVariables(variables: {[ key: string ]: string}): JobCollection

Calling gcix.Job.addVariables({...}) to all jobs within this JobCollection and overriding any previously added variables to that jobs.

variablesRequired
  • Type: {[ key: string ]: string}

???


Properties

Name Type Description
lastJobsExecuted Job[] This property returns all Jobs from the last stage of this JobCollection.
nestedJobs Job[] No description.
populatedJobs Job[] Returns a list with populated copies of all nested jobs of this JobCollection.
children ChildDict[] No description.
orderedTags OrderedStringSet No description.
orderedTagsForInitialization OrderedStringSet No description.
orderedTagsForReplacement OrderedStringSet No description.
parents Job | JobCollection[] No description.
allowFailureForInitialization string | boolean | number[] No description.
allowFailureForReplacement string | boolean | number[] No description.
artifacts Artifacts No description.
artifactsForInitialization Artifacts No description.
artifactsForReplacement Artifacts No description.
cache Cache No description.
cacheForInitialization Cache No description.
dependencies Job | JobCollection | Need[] No description.
dependenciesForInitialization Job | JobCollection | Need[] No description.
dependenciesForReplacement Job | JobCollection | Need[] No description.
imageForInitialization string | Image No description.
imageForReplacement string | Image No description.
needs Job | JobCollection | Need[] No description.
needsForInitialization Job | JobCollection | Need[] No description.
needsForReplacement Job | JobCollection | Need[] No description.
rulesForInitialization Rule[] No description.
rulesForReplacement Rule[] No description.
rulesToAppend Rule[] No description.
rulesToPrepend Rule[] No description.
scriptsToAppend string[] No description.
scriptsToPrepend string[] No description.
variables {[ key: string ]: string} No description.
variablesForInitialization {[ key: string ]: string} No description.
variablesForReplacement {[ key: string ]: string} No description.

lastJobsExecutedRequired
public readonly lastJobsExecuted: Job[];

This property returns all Jobs from the last stage of this JobCollection.

This is typically be requested from a job which has setup this JobCollection as need, to determine all actual jobs of this JobCollection as need.


nestedJobsRequired
public readonly nestedJobs: Job[];

populatedJobsRequired
public readonly populatedJobs: Job[];

Returns a list with populated copies of all nested jobs of this JobCollection.

Populated means, that all attributes of a Job which depends on its context are resolved to their final values. The context is primarily the JobCollection within the jobs resides but also dependencies to other jobs and JobCollection's. Thus this JobCollection will apply its own configuration, like variables to add, tags to set, etc., to all its jobs and JobCollection's.

Copies means what it says, that the returned job are not the same job objects, originally added to this JobCollection, but copies of them.

Nested means, that also jobs from JobCollection's within this JobCollection, are returned, as well as jobs from JobCollection's within JobCollection's within this JobCollection and so on.


childrenRequired
public readonly children: ChildDict[];

orderedTagsRequired
public readonly orderedTags: OrderedStringSet;

orderedTagsForInitializationRequired
public readonly orderedTagsForInitialization: OrderedStringSet;

orderedTagsForReplacementRequired
public readonly orderedTagsForReplacement: OrderedStringSet;

parentsRequired
public readonly parents: Job | JobCollection[];

allowFailureForInitializationOptional
public readonly allowFailureForInitialization: string | boolean | number[];
  • Type: string | boolean | number[]

allowFailureForReplacementOptional
public readonly allowFailureForReplacement: string | boolean | number[];
  • Type: string | boolean | number[]

artifactsOptional
public readonly artifacts: Artifacts;

artifactsForInitializationOptional
public readonly artifactsForInitialization: Artifacts;

artifactsForReplacementOptional
public readonly artifactsForReplacement: Artifacts;

cacheOptional
public readonly cache: Cache;

cacheForInitializationOptional
public readonly cacheForInitialization: Cache;

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];

dependenciesForInitializationOptional
public readonly dependenciesForInitialization: Job | JobCollection | Need[];

dependenciesForReplacementOptional
public readonly dependenciesForReplacement: Job | JobCollection | Need[];

imageForInitializationOptional
public readonly imageForInitialization: string | Image;

imageForReplacementOptional
public readonly imageForReplacement: string | Image;

needsOptional
public readonly needs: Job | JobCollection | Need[];

needsForInitializationOptional
public readonly needsForInitialization: Job | JobCollection | Need[];

needsForReplacementOptional
public readonly needsForReplacement: Job | JobCollection | Need[];

rulesForInitializationOptional
public readonly rulesForInitialization: Rule[];

rulesForReplacementOptional
public readonly rulesForReplacement: Rule[];

rulesToAppendOptional
public readonly rulesToAppend: Rule[];

rulesToPrependOptional
public readonly rulesToPrepend: Rule[];

scriptsToAppendOptional
public readonly scriptsToAppend: string[];
  • Type: string[]

scriptsToPrependOptional
public readonly scriptsToPrepend: string[];
  • Type: string[]

variablesOptional
public readonly variables: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

variablesForInitializationOptional
public readonly variablesForInitialization: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

variablesForReplacementOptional
public readonly variablesForReplacement: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

IJobCollectionBase

  • Extends: IBase

  • Implemented By: @gcix/gcix.aws.CdkDiffDeploy, @gcix/gcix.container.BuildContainerCollection, @gcix/gcix.container.BuildGitlabContainerCollection, @gcix/gcix.container.CopyContainerCollection, @gcix/gcix.python.PythonFullStack, JobCollection, Pipeline, IJobCollection, IJobCollectionBase

Methods

Name Description
addDependencies No description.
addNeeds No description.
addTags No description.
addVariables No description.
appendRules No description.
appendScripts No description.
assignArtifacts No description.
assignCache No description.
getAllInstanceNames Return all instance names from the given child.
prependRules No description.
prependScripts No description.

addDependencies
public addDependencies(dependencies: Job | JobCollection | Need[]): JobCollection
dependenciesRequired

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): JobCollection
needsRequired

addTags
public addTags(tags: string[]): JobCollection
tagsRequired
  • Type: string[]

addVariables
public addVariables(variables: {[ key: string ]: string}): JobCollection
variablesRequired
  • Type: {[ key: string ]: string}

appendRules
public appendRules(rules: Rule[]): JobCollection
rulesRequired

appendScripts
public appendScripts(scripts: string[]): JobCollection
scriptsRequired
  • Type: string[]

assignArtifacts
public assignArtifacts(artifacts: Artifacts): JobCollection
artifactsRequired

assignCache
public assignCache(cache: Cache): JobCollection
cacheRequired

getAllInstanceNames
public getAllInstanceNames(child?: Job | JobCollection): OrderedStringSet

Return all instance names from the given child.

That means all combinations of the childs name and stage within this JobCollection and all parent JobCollection's.

childOptional

prependRules
public prependRules(rules: Rule[]): JobCollection
rulesRequired

prependScripts
public prependScripts(scripts: string[]): JobCollection
scriptsRequired
  • Type: string[]

INeed

IPagesJob

Methods

Name Description
assignStage Set the name of this jobs stage to a value other than pages.
copy There should be only one instance of this job, that is why this method does not return a copy of this job but the job itself.
extendName The jobs name pages is fixed and can't be altered.
extendStage The stage name can't be altered from parent sequences.
extendStageValue Extending the name of the stage is not allowed on this Job.

assignStage
public assignStage(stage: string): PagesJob

Set the name of this jobs stage to a value other than pages.

stageRequired
  • Type: string

A valid Gitlab CI Job stage name.


copy
public copy(): Job

There should be only one instance of this job, that is why this method does not return a copy of this job but the job itself.

extendName
public extendName(name: string): void

The jobs name pages is fixed and can't be altered.

nameRequired
  • Type: string

extendStage
public extendStage(name: string): void

The stage name can't be altered from parent sequences.

nameRequired
  • Type: string

extendStageValue
public extendStageValue(name: string): void

Extending the name of the stage is not allowed on this Job.

nameRequired
  • Type: string

IPipeline

Methods

Name Description
addInclude Let you add global gcix.Includes to the pipeline. Gitlab CI Documentation: "Use include to include external YAML files in your CI/CD configuration.".
addServices Add one or more gcix.Services to the pipeline.
writeYaml Create the Gitlab CI YAML file from this pipeline object.

addInclude
public addInclude(include: Include): Pipeline

Let you add global gcix.Includes to the pipeline. Gitlab CI Documentation: "Use include to include external YAML files in your CI/CD configuration.".

includeRequired

addServices
public addServices(services: Service[]): Pipeline

Add one or more gcix.Services to the pipeline.

Gitlab CI Documentation: "The services keyword defines a Docker image that runs during a job linked to the Docker image that the image keyword defines."

servicesRequired

simply use strings to name the services to link to the pipeline.

Use objects of the gcix.Service class for more complex service configurations.


writeYaml
public writeYaml(filename?: string): void

Create the Gitlab CI YAML file from this pipeline object.

Use that YAML file to trigger a child pipeline.

filenameOptional
  • Type: string

the file name of the created yaml file.


Properties

Name Type Description
includes Include[] No description.
service Service[] No description.

includesRequired
public readonly includes: Include[];

serviceRequired
public readonly service: Service[];

IRule

Methods

Name Description
addVariables Adds one or more variables, each as keyword argument, to the rule.
never This method is intended to be used for predefined rules.

addVariables
public addVariables(variables: {[ key: string ]: string}): Rule

Adds one or more variables, each as keyword argument, to the rule.

rule.addVariables({GREETING: "hello", LANGUAGE: "typescript"})
variablesRequired
  • Type: {[ key: string ]: string}

Each variable would be provided as keyword argument:.


never
public never(): Rule

This method is intended to be used for predefined rules.

For instance you have defined an often used rule on_master whose if statement checks if the pipeline is executed on branch master. Then you can either run a job, if on master...

myJob.appendRules(onMaster)

... or do not run a job if on master...

myJob.appendRules(onMaster.never())

IService

Properties

Name Type Description
name string No description.

nameRequired
public readonly name: string;
  • Type: string

ITriggerJob

Properties

Name Type Description
branch string The branch of project the pipeline should be triggered of.
includes IncludeLocal | IncludeFile | IncludeRemote | IncludeTemplate | IncludeArtifact[] Include a pipeline to trigger (Parent-child pipeline trigger) Mutually exclusiv with project.
project string The full name of another Gitlab project to trigger (multi-project pipeline trigger).
strategy string Determines if the result of this pipeline depends on the triggered downstream pipeline (use TriggerStrategy.DEPEND) or if just "fire and forget" the downstream pipeline (use None).

branchOptional
public readonly branch: string;
  • Type: string

The branch of project the pipeline should be triggered of.


includesOptional
public readonly includes: IncludeLocal | IncludeFile | IncludeRemote | IncludeTemplate | IncludeArtifact[];

Include a pipeline to trigger (Parent-child pipeline trigger) Mutually exclusiv with project.


projectOptional
public readonly project: string;
  • Type: string

The full name of another Gitlab project to trigger (multi-project pipeline trigger).

Mutually exclusive with includes.


strategyOptional
public readonly strategy: string;
  • Type: string

Determines if the result of this pipeline depends on the triggered downstream pipeline (use TriggerStrategy.DEPEND) or if just "fire and forget" the downstream pipeline (use None).


Enums

CachePolicy

This enum represents the cache:policy keyword. The policy determines if a Job can modify the cache or read him only.

Members

Name Description
PULLPUSH The default behavior of a caching job is to download the files at the start of execution and re-upload them at the end.
PULL If you are certain that the job does not modify the cached files, you can specify this policy to skip the upload step.

PULLPUSH

The default behavior of a caching job is to download the files at the start of execution and re-upload them at the end.

This behavior ensures that any changes made by the job are persisted for future runs.


PULL

If you are certain that the job does not modify the cached files, you can specify this policy to skip the upload step.

By setting this policy, the job will only download the cached files at the start of execution without re-uploading them at the end.


WhenStatement

This enum holds different when statements for Rules.

Members

Name Description
ALWAYS No description.
DELAYED No description.
MANUAL No description.
NEVER No description.
ONFAILURE No description.
ONSUCCESS No description.

ALWAYS

DELAYED

MANUAL

NEVER

ONFAILURE

ONSUCCESS