Skip to content

git Submodule

Structs

GitMirrorProps

Initializer

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

const gitMirrorProps: git.GitMirrorProps = { ... }

Properties

Name Type Description
remoteRepository string The git repository the code of the pipelines repository should be mirrored to.
gitConfigUserEmail string The 'user.email' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_EMAIL.
gitConfigUserName string The 'user.name' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_NAME.
jobName string The name of the Bootstrap job.
jobStage string The stage of the Bootstrap job.
privateKeyVariable string DO NOT PROVIDE YOUR PRIVATE SSH KEY HERE!!! This parameter takes the name of the Gitlab environment variable, which contains the private ssh key used to push to the remote repository. This one should be created as protected and masked variable in the 'CI/CD' settings of your project.
runOnlyForRepositoryUrl string When mirroring to a remote Gitlab instance, you don't want to run this mirroring job there again.
scriptHook string[] This list of strings could contain any commands that should be executed between pulling the current repository and pushing it to the remote.

remoteRepositoryRequired
public readonly remoteRepository: string;
  • Type: string

The git repository the code of the pipelines repository should be mirrored to.


gitConfigUserEmailOptional
public readonly gitConfigUserEmail: string;
  • Type: string

The 'user.email' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_EMAIL.


gitConfigUserNameOptional
public readonly gitConfigUserName: string;
  • Type: string

The 'user.name' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_NAME.


jobNameOptional
public readonly jobName: string;
  • Type: string

The name of the Bootstrap job.


jobStageOptional
public readonly jobStage: string;
  • Type: string

The stage of the Bootstrap job.


privateKeyVariableOptional
public readonly privateKeyVariable: string;
  • Type: string

DO NOT PROVIDE YOUR PRIVATE SSH KEY HERE!!! This parameter takes the name of the Gitlab environment variable, which contains the private ssh key used to push to the remote repository. This one should be created as protected and masked variable in the 'CI/CD' settings of your project.


runOnlyForRepositoryUrlOptional
public readonly runOnlyForRepositoryUrl: string;
  • Type: string

When mirroring to a remote Gitlab instance, you don't want to run this mirroring job there again.

With this variable the job only runs, when its value matches the CI_REPOSITORY_URL of the current repository.


scriptHookOptional
public readonly scriptHook: string[];
  • Type: string[]

This list of strings could contain any commands that should be executed between pulling the current repository and pushing it to the remote.

This hook is mostly meant to be for git configuration commands, required to push to the remote repository.


Classes

GitMirror

This job clones the CI_COMMIT_REF_NAME of the current repository and forcefully pushes this REF to the remote_repository.

This subclass of Job will configure following defaults for the superclass:

  • name: git-mirror
  • stage: deploy
  • image: PredefinedImages.ALPINE_GIT

Initializers

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

new git.GitMirror(props: GitMirrorProps)
Name Type Description
props GitMirrorProps 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
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[]

addNeeds
public addNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[]

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
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection

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
  • Type: @gcix/gcix.Rule[]

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
  • Type: @gcix/gcix.Artifacts

assignCache
public assignCache(cache: Cache): Job
cacheRequired
  • Type: @gcix/gcix.Cache

assignDependencies
public assignDependencies(dependencies: Job | JobCollection | Need[]): Job
dependenciesRequired
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[]

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
  • Type: string | @gcix/gcix.Image

assignNeeds
public assignNeeds(needs: Job | JobCollection | Need[]): Job
needsRequired
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[]

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
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection

isEqual
public isEqual(comparable: IBase): boolean

isEqual checks if this object is equal to given object.

comparableRequired
  • Type: @gcix/gcix.IBase

prependRules
public prependRules(rules: Rule[]): Job
rulesRequired
  • Type: @gcix/gcix.Rule[]

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 @gcix/gcix.OrderedStringSet No description.
parents @gcix/gcix.Job | @gcix/gcix.JobCollection[] No description.
scripts string[] No description.
stage string No description.
artifacts @gcix/gcix.Artifacts No description.
cache @gcix/gcix.Cache No description.
dependencies @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[] No description.
image @gcix/gcix.Image No description.
needs @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[] No description.
original @gcix/gcix.Job No description.
rules @gcix/gcix.Rule[] No description.
variables {[ key: string ]: string} No description.
gitConfigUserEmail string The 'user.email' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_EMAIL.
gitConfigUserName string The 'user.name' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_NAME.
remoteRepository string The git repository the code of the pipelines repository should be mirrored to.
scriptHook string[] This list of strings could contain any commands that should be executed between pulling the current repository and pushing it to the remote.
privateKeyVariable string DO NOT PROVIDE YOUR PRIVATE SSH KEY HERE!!! This parameter takes the name of the Gitlab environment variable, which contains the private ssh key used to push to the remote repository. This one should be created as protected and masked variable in the 'CI/CD' settings of your project.
runOnlyForRepositoryUrl string When mirroring to a remote Gitlab instance, you don't want to run this mirroring job there again.

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;
  • Type: @gcix/gcix.OrderedStringSet

parentsRequired
public readonly parents: Job | JobCollection[];
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection[]

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

stageRequired
public readonly stage: string;
  • Type: string

artifactsOptional
public readonly artifacts: Artifacts;
  • Type: @gcix/gcix.Artifacts

cacheOptional
public readonly cache: Cache;
  • Type: @gcix/gcix.Cache

dependenciesOptional
public readonly dependencies: Job | JobCollection | Need[];
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[]

imageOptional
public readonly image: Image;
  • Type: @gcix/gcix.Image

needsOptional
public readonly needs: Job | JobCollection | Need[];
  • Type: @gcix/gcix.Job | @gcix/gcix.JobCollection | @gcix/gcix.Need[]

originalOptional
public readonly original: Job;
  • Type: @gcix/gcix.Job

rulesOptional
public readonly rules: Rule[];
  • Type: @gcix/gcix.Rule[]

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

gitConfigUserEmailRequired
public readonly gitConfigUserEmail: string;
  • Type: string

The 'user.email' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_EMAIL.


gitConfigUserNameRequired
public readonly gitConfigUserName: string;
  • Type: string

The 'user.name' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_NAME.


remoteRepositoryRequired
public readonly remoteRepository: string;
  • Type: string

The git repository the code of the pipelines repository should be mirrored to.


scriptHookRequired
public readonly scriptHook: string[];
  • Type: string[]

This list of strings could contain any commands that should be executed between pulling the current repository and pushing it to the remote.

This hook is mostly meant to be for git configuration commands, required to push to the remote repository.


privateKeyVariableOptional
public readonly privateKeyVariable: string;
  • Type: string

DO NOT PROVIDE YOUR PRIVATE SSH KEY HERE!!! This parameter takes the name of the Gitlab environment variable, which contains the private ssh key used to push to the remote repository. This one should be created as protected and masked variable in the 'CI/CD' settings of your project.


runOnlyForRepositoryUrlOptional
public readonly runOnlyForRepositoryUrl: string;
  • Type: string

When mirroring to a remote Gitlab instance, you don't want to run this mirroring job there again.

With this variable the job only runs, when its value matches the CI_REPOSITORY_URL of the current repository.


Protocols

IGitMirror

  • Implemented By: @gcix/gcix.aws.CdkMirrorToCodecommit, GitMirror, @gcix/gcix.aws.ICdkMirrorToCodecommit, IGitMirror

Properties

Name Type Description
gitConfigUserEmail string The 'user.email' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_EMAIL.
gitConfigUserName string The 'user.name' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_NAME.
remoteRepository string The git repository the code of the pipelines repository should be mirrored to.
scriptHook string[] This list of strings could contain any commands that should be executed between pulling the current repository and pushing it to the remote.
privateKeyVariable string DO NOT PROVIDE YOUR PRIVATE SSH KEY HERE!!! This parameter takes the name of the Gitlab environment variable, which contains the private ssh key used to push to the remote repository. This one should be created as protected and masked variable in the 'CI/CD' settings of your project.
runOnlyForRepositoryUrl string When mirroring to a remote Gitlab instance, you don't want to run this mirroring job there again.

gitConfigUserEmailRequired
public readonly gitConfigUserEmail: string;
  • Type: string

The 'user.email' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_EMAIL.


gitConfigUserNameRequired
public readonly gitConfigUserName: string;
  • Type: string

The 'user.name' with which the commits to the remote repository should be made. Defaults to GITLAB_USER_NAME.


remoteRepositoryRequired
public readonly remoteRepository: string;
  • Type: string

The git repository the code of the pipelines repository should be mirrored to.


scriptHookRequired
public readonly scriptHook: string[];
  • Type: string[]

This list of strings could contain any commands that should be executed between pulling the current repository and pushing it to the remote.

This hook is mostly meant to be for git configuration commands, required to push to the remote repository.


privateKeyVariableOptional
public readonly privateKeyVariable: string;
  • Type: string

DO NOT PROVIDE YOUR PRIVATE SSH KEY HERE!!! This parameter takes the name of the Gitlab environment variable, which contains the private ssh key used to push to the remote repository. This one should be created as protected and masked variable in the 'CI/CD' settings of your project.


runOnlyForRepositoryUrlOptional
public readonly runOnlyForRepositoryUrl: string;
  • Type: string

When mirroring to a remote Gitlab instance, you don't want to run this mirroring job there again.

With this variable the job only runs, when its value matches the CI_REPOSITORY_URL of the current repository.