Commit 3ced4aa3 authored by Carine Dengler's avatar Carine Dengler

chore: construct images for combinations of stretch/buster, py{27,35,37}

parent 16790850120e
ARG DIST
ARG PYTHON
FROM debian:$DIST-slim
RUN apt-get update && \
apt-get -y --no-install-recommends install \
......@@ -10,4 +11,4 @@ RUN echo "deb http://apt.logilab.fr $DIST main" > /etc/apt/sources.list.d/logila
RUN wget -O - https://apt.logilab.fr/key.asc | apt-key --keyring /etc/apt/trusted.gpg.d/logilab.gpg add -
CMD apt-get update > /dev/null && \
apt-cache show python3-cubicweb | grep '^Version' | cut -f2 -d' '
apt-cache show "$PYTHON"-cubicweb | grep '^Version' | cut -f2 -d' '
......@@ -136,38 +136,40 @@ def build_buildpackage(dist):
'--build-arg', 'DIST={}'.format(dist),
'-f', 'Dockerfile.buildpackage', '.')
def get_cubicweb_images(debian_dists: list[str]):
def get_cubicweb_images(debian_dists: list[str], python_versions: list[str]):
images = []
for dist in debian_dists:
check_call(
'docker',
'build',
'.',
'-f',
'Dockerfile.getversion',
'-t',
'cubicweb:getversion',
'--build-arg',
f'DIST={dist}'
)
versions = check_output(
'docker', 'run', '--rm', 'cubicweb:getversion'
).splitlines()
# filter release candidate version
valid_versions = [
version for version in versions if '~rc' not in version
]
images = []
for version in valid_versions:
image = CubicWebImage(
python='py37',
debian=dist,
package_name='python3-cubicweb',
package_version=version
for python_version in python_versions:
python = 'python' if python_version == 'py27' else 'python3'
check_call(
'docker',
'build',
'.',
'-f',
'Dockerfile.getversion',
'-t',
'cubicweb:getversion',
'--build-arg',
f'DIST={dist}',
'--build-arg',
f"PYTHON={python}"
)
images.append(image)
versions = check_output(
'docker', 'run', '--rm', 'cubicweb:getversion'
).splitlines()
# filter release candidate version
valid_versions = [
version for version in versions if '~rc' not in version
]
for version in valid_versions:
image = CubicWebImage(
python=python_version,
debian=dist,
package_name=f'{python}-cubicweb',
package_version=version
)
images.append(image)
return images
def build(debian_dists, images=[], rebuild=False):
......@@ -229,7 +231,9 @@ if __name__ == '__main__':
help='push images')
args = parser.parse_args()
REGISTRY = args.registry
images = get_cubicweb_images(["stretch", "buster"])
images = get_cubicweb_images(["stretch", "buster"], ["py27"])
images += get_cubicweb_images(["stretch"], ["py35"])
images += get_cubicweb_images(["buster"], ["py37"])
if args.push:
push()
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment