Skip to content

Instantly share code, notes, and snippets.

@andrasKelle
Created September 21, 2021 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrasKelle/323daf68bc19957ec5071e32ee6286c5 to your computer and use it in GitHub Desktop.
Save andrasKelle/323daf68bc19957ec5071e32ee6286c5 to your computer and use it in GitHub Desktop.
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