Skip to content

gitlab Submodule

Structs

PagesAsciiDoctorProps

Initializer

1
2
3
4
5
6
7
8
from gcix import gitlab

gitlab.PagesAsciiDoctorProps(
  out_file: str,
  source: str,
  job_name: str = None,
  job_stage: str = None
)

Properties

Name Type Description
out_file str Output HTML file.
source str Source .adoc files to translate to HTML files.
job_name str The name of the job.
job_stage str The stage of the job.

out_fileRequired
out_file: str
  • Type: str

Output HTML file.


sourceRequired
source: str
  • Type: str

Source .adoc files to translate to HTML files.


job_nameOptional
job_name: str
  • Type: str

The name of the job.


job_stageOptional
job_stage: str
  • Type: str

The stage of the job.


Classes

GitlabScripts

GitlabScripts Class Documentation.

The GitlabScripts class provides utility methods for performing various Git-related actions in the context of GitLab.

Static Functions

Name Description
clone_repository Clones a repository from a remote Git server using the Git command.

clone_repository
1
2
3
4
5
6
from gcix import gitlab

gitlab.GitlabScripts.clone_repository(
  path: str,
  branch: str = None
)

Clones a repository from a remote Git server using the Git command.

pathRequired
  • Type: str

The path of the repository to clone.

Should start with a forward slash ("/").


branchOptional
  • Type: str

(Optional) The branch name to clone from the remote repository.

Currently, only "main" is supported.


PagesAsciiDoctor

Translate the AsciiDoc source FILE as Gitlab Pages HTML5 file.

Runs asciidoctor {source} -o public{out_file}and stores the output as artifact under the public directory.

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

  • name: asciidoctor-pages
  • stage: build
  • image: ruby:3-alpine
  • artifacts: Path 'public'

Initializers

1
2
3
4
5
6
7
8
from gcix import gitlab

gitlab.PagesAsciiDoctor(
  out_file: str,
  source: str,
  job_name: str = None,
  job_stage: str = None
)
Name Type Description
out_file str Output HTML file.
source str Source .adoc files to translate to HTML files.
job_name str The name of the job.
job_stage str The stage of the job.

out_fileRequired
  • Type: str

Output HTML file.


sourceRequired
  • Type: str

Source .adoc files to translate to HTML files.


job_nameOptional
  • Type: str

The name of the job.


job_stageOptional
  • Type: str

The stage of the job.


Methods

Name Description
add_dependencies No description.
add_needs No description.
add_parent This method is called by gcix.JobCollections when the job is added to that JobCollection.
add_tags No description.
add_variables No description.
append_rules No description.
append_scripts No description.
assign_allow_failure No description.
assign_artifacts No description.
assign_cache No description.
assign_dependencies No description.
assign_image Sets the image of this job.
assign_needs No description.
assign_tags No description.
copy Returns an independent, deep copy object of this job.
extend_name This method is used by gcix.JobCollections to populate the jobs name.
extend_stage This method is used by gcix.JobCollections to populate the jobs name and stage.
extend_stage_value This method is used by gcix.JobCollections to populate the jobs stage.
get_all_instance_names Return all instance names from the given child.
is_equal isEqual checks if this object is equal to given object.
prepend_rules No description.
prepend_scripts No description.
render Returns a representation of any object which implements IBase.

add_dependencies
1
2
3
def add_dependencies(
  dependencies: typing.List[typing.Union[Job, JobCollection, Need]]
) -> Job
dependenciesRequired
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]]

add_needs
1
2
3
def add_needs(
  needs: typing.List[typing.Union[Job, JobCollection, Need]]
) -> Job
needsRequired
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]]

add_parent
1
2
3
def add_parent(
  parent: typing.Union[Job, JobCollection]
) -> None

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: typing.Union[gcix.Job, gcix.JobCollection]

add_tags
1
2
3
def add_tags(
  tags: typing.List[str]
) -> Job
tagsRequired
  • Type: typing.List[str]

add_variables
1
2
3
def add_variables(
  variables: typing.Mapping[str]
) -> Job
variablesRequired
  • Type: typing.Mapping[str]

append_rules
1
2
3
def append_rules(
  rules: typing.List[Rule]
) -> Job
rulesRequired
  • Type: typing.List[gcix.Rule]

append_scripts
1
2
3
def append_scripts(
  scripts: typing.List[str]
) -> Job
scriptsRequired
  • Type: typing.List[str]

assign_allow_failure
1
2
3
def assign_allow_failure(
  allow_failure: typing.Union[bool, typing.List[typing.Union[int, float]]]
) -> Job
allow_failureRequired
  • Type: typing.Union[bool, typing.List[typing.Union[int, float]]]

assign_artifacts
1
2
3
def assign_artifacts(
  artifacts: Artifacts
) -> Job
artifactsRequired
  • Type: gcix.Artifacts

assign_cache
1
2
3
def assign_cache(
  cache: Cache
) -> Job
cacheRequired
  • Type: gcix.Cache

assign_dependencies
1
2
3
def assign_dependencies(
  dependencies: typing.List[typing.Union[Job, JobCollection, Need]]
) -> Job
dependenciesRequired
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]]

assign_image
1
2
3
def assign_image(
  image: typing.Union[str, 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: typing.Union[str, gcix.Image]

assign_needs
1
2
3
def assign_needs(
  needs: typing.List[typing.Union[Job, JobCollection, Need]]
) -> Job
needsRequired
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]]

assign_tags
1
2
3
def assign_tags(
  tags: typing.List[str]
) -> Job
tagsRequired
  • Type: typing.List[str]

copy
def copy() -> Job

Returns an independent, deep copy object of this job.

extend_name
1
2
3
def extend_name(
  name: str
) -> None

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

nameRequired
  • Type: str

extend_stage
1
2
3
def extend_stage(
  stage: str
) -> None

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

stageRequired
  • Type: str

extend_stage_value
1
2
3
def extend_stage_value(
  stage: str
) -> None

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

stageRequired
  • Type: str

get_all_instance_names
1
2
3
def get_all_instance_names(
  child: typing.Union[Job, JobCollection] = None
) -> 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: typing.Union[gcix.Job, gcix.JobCollection]

is_equal
1
2
3
def is_equal(
  comparable: IBase
) -> bool

isEqual checks if this object is equal to given object.

comparableRequired
  • Type: gcix.IBase

prepend_rules
1
2
3
def prepend_rules(
  rules: typing.List[Rule]
) -> Job
rulesRequired
  • Type: typing.List[gcix.Rule]

prepend_scripts
1
2
3
def prepend_scripts(
  scripts: typing.List[str]
) -> Job
scriptsRequired
  • Type: typing.List[str]

render
def render() -> typing.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 typing.List[str] Getter method to receive added tags.
allow_failure typing.Union[str, bool, typing.List[typing.Union[int, float]]] No description.
name str No description.
ordered_tags gcix.OrderedStringSet No description.
parents typing.List[typing.Union[gcix.Job, gcix.JobCollection]] No description.
scripts typing.List[str] No description.
stage str No description.
artifacts gcix.Artifacts No description.
cache gcix.Cache No description.
dependencies typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]] No description.
image gcix.Image No description.
needs typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]] No description.
original gcix.Job No description.
rules typing.List[gcix.Rule] No description.
variables typing.Mapping[str] No description.
out_file str Output HTML file.
source str Source .adoc files to translate to HTML files.

tagsRequired
tags: typing.List[str]
  • Type: typing.List[str]

Getter method to receive added tags.


allow_failureRequired
allow_failure: typing.Union[str, bool, typing.List[typing.Union[int, float]]]
  • Type: typing.Union[str, bool, typing.List[typing.Union[int, float]]]

nameRequired
name: str
  • Type: str

ordered_tagsRequired
ordered_tags: OrderedStringSet
  • Type: gcix.OrderedStringSet

parentsRequired
parents: typing.List[typing.Union[Job, JobCollection]]
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection]]

scriptsRequired
scripts: typing.List[str]
  • Type: typing.List[str]

stageRequired
stage: str
  • Type: str

artifactsOptional
artifacts: Artifacts
  • Type: gcix.Artifacts

cacheOptional
cache: Cache
  • Type: gcix.Cache

dependenciesOptional
dependencies: typing.List[typing.Union[Job, JobCollection, Need]]
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]]

imageOptional
image: Image
  • Type: gcix.Image

needsOptional
needs: typing.List[typing.Union[Job, JobCollection, Need]]
  • Type: typing.List[typing.Union[gcix.Job, gcix.JobCollection, gcix.Need]]

originalOptional
original: Job
  • Type: gcix.Job

rulesOptional
rules: typing.List[Rule]
  • Type: typing.List[gcix.Rule]

variablesOptional
variables: typing.Mapping[str]
  • Type: typing.Mapping[str]

out_fileRequired
out_file: str
  • Type: str

Output HTML file.


sourceRequired
source: str
  • Type: str

Source .adoc files to translate to HTML files.


Protocols

IPagesAsciiDoctor

Properties

Name Type Description
out_file str Output HTML file.
source str Source .adoc files to translate to HTML files.

out_fileRequired
out_file: str
  • Type: str

Output HTML file.


sourceRequired
source: str
  • Type: str

Source .adoc files to translate to HTML files.