Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ci-dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
ci-dockerfiles
Merge requests
!26
chore: add the 3.9 and 3.11 versions for python-logilab image
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
chore: add the 3.9 and 3.11 versions for python-logilab image
topic/default/python-logilab-versions
into
branch/default
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Aurélien Lubert
requested to merge
topic/default/python-logilab-versions
into
branch/default
6 months ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
branch/default
version 1
6c06f350
6 months ago
branch/default (base)
and
latest version
latest version
0883ca91
1 commit,
6 months ago
version 1
6c06f350
1 commit,
6 months ago
1 file
+
15
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
generate_gitlabci.py
+
15
−
5
Options
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