Skip to content
Snippets Groups Projects

chore: add the 3.9 and 3.11 versions for python-logilab image

Merged Aurélien Lubert requested to merge topic/default/python-logilab-versions into branch/default
1 file
+ 15
5
Compare changes
  • Side-by-side
  • Inline
+ 15
5
import glob
TEMPLATE = '''
build_{project}:
build_{project}{tag}:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
@@ -11,5 +11,6 @@
- echo "{{\\"auths\\":{{\\"$CI_REGISTRY\\":{{\\"username\\":\\"$CI_REGISTRY_USER\\",\\"password\\":\\"$CI_REGISTRY_PASSWORD\\"}}}}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--build-arg version={version}
--context $CI_PROJECT_DIR/{context}
--dockerfile $CI_PROJECT_DIR/{filepath}
@@ -14,8 +15,8 @@
--context $CI_PROJECT_DIR/{context}
--dockerfile $CI_PROJECT_DIR/{filepath}
--destination $CI_REGISTRY_IMAGE/{project}
--destination $CI_REGISTRY_IMAGE/{project}:{version}
--cache=true
--cache-repo $CI_REGISTRY_IMAGE/cache
--cache-ttl 120h
'''
@@ -17,9 +18,13 @@
--cache=true
--cache-repo $CI_REGISTRY_IMAGE/cache
--cache-ttl 120h
'''
VERSIONS = {
"python-logilab": ["3.9", "3.11", "latest"],
}
with open('gitlab-ci-generated.yml', 'w') as f:
for filepath in sorted(glob.glob('library/**/Dockerfile', recursive=True)):
project = '-'.join(filepath.split('/')[1:-1])
context = filepath.replace('/Dockerfile', '')
@@ -22,7 +27,12 @@
with open('gitlab-ci-generated.yml', 'w') as f:
for filepath in sorted(glob.glob('library/**/Dockerfile', recursive=True)):
project = '-'.join(filepath.split('/')[1:-1])
context = filepath.replace('/Dockerfile', '')
f.write(TEMPLATE.format(project=project,
context=context,
filepath=filepath))
for version in VERSIONS.get(project, ["latest"]):
f.write(TEMPLATE.format(
project=project,
context=context,
filepath=filepath,
version=version,
tag="" if version == "latest" else f"_{version}"
))
Loading