Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is an example of child pipeline generation on Gitlab
class PipelineWriter:
@staticmethod
def parent_job_template():
parent_job_template = """
stages:
- build-libs
.basic:
interruptible: false
allow_failure: false
retry:
max: 2
when:
- runner_system_failure
"""
return parent_job_template
@staticmethod
def child_pipeline_job_template(lib):
child_pipeline_job_template = f"""
build-{lib}-lib:
extends: .basic
stage: build-libs
variables:
BUILD_LIB: {lib}
script:
- echo $BUILD_LIB
"""
return child_pipeline_job_template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment