Skip to content
Snippets Groups Projects
Commit d42bca9f19c5 authored by François Ferry's avatar François Ferry
Browse files

feat: add stages in image generation

fix: #2
parent 1630c5ac8bcc
No related branches found
No related tags found
1 merge request!28feat: add stages in image generation
Pipeline #247867 passed
......@@ -2,6 +2,7 @@
TEMPLATE = '''
build_{project}{tag}:
stage: {stage}
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
......@@ -24,4 +25,11 @@
"python-logilab": ["3.9", "3.11", "latest"],
}
STAGE_2_PROJECTS = {
"bullseye-slim-pg13-crm",
"bullseye-slim-pg13-firefox",
"bullseye-slim-pg13-ldap",
"bookworm-slim-pg15-ldap"
}
with open('gitlab-ci-generated.yml', 'w') as f:
......@@ -27,4 +35,11 @@
with open('gitlab-ci-generated.yml', 'w') as f:
f.write(
"""
stages:
- stage1
- stage2
"""
)
for filepath in sorted(glob.glob('library/**/Dockerfile', recursive=True)):
project = '-'.join(filepath.split('/')[1:-1])
context = filepath.replace('/Dockerfile', '')
......@@ -34,5 +49,6 @@
context=context,
filepath=filepath,
version=version,
tag="" if version == "latest" else f"_{version}"
tag="" if version == "latest" else f"_{version}",
stage="stage2" if project in STAGE_2_PROJECTS else "stage1",
))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment