Skip to content
Snippets Groups Projects

CI/CD: fixing the single arch package job

Files
3
+ 12
4
@@ -141,7 +141,7 @@
run(cmd)
def main_image(namespace, archs, push=False):
def main_image(namespace, archs, push=False, **kw):
buildx(namespace + '/runner', archs, push=push)
@@ -145,7 +145,7 @@
buildx(namespace + '/runner', archs, push=push)
def helper_image(namespace, archs, push=False):
def helper_image(namespace, archs, with_pwsh=True, push=False):
helper_image_repo = namespace + '/helper'
sha = hg_short_sha()
version = docker_version_tag()
@@ -155,7 +155,8 @@
variants = ['']
if arch == 'amd64':
arch = 'x86_64'
variants.append('-pwsh')
if with_pwsh:
variants.append('-pwsh')
for variant in variants:
tarball = f'out/helper-images/prebuilt-{arch}{variant}.tar.xz'
@@ -198,6 +199,9 @@
parser.add_argument("--arch", nargs='*', default=['amd64'],
help="Architecture, in Docker style (amd64 etc.)"
)
parser.add_argument("--no-pwsh", action='store_true',
help="Avoid building pwsh variants for *nix platforms",
)
parser.add_argument('--push', action='store_true')
scope_grp = parser.add_mutually_exclusive_group()
scope_grp.add_argument("--helper", "--helper-only",
@@ -226,6 +230,10 @@
docker_login(registry,
env['CI_REGISTRY_USER'],
env['CI_REGISTRY_PASSWORD'])
opts = {}
if cl_args.no_pwsh:
opts['with_pwsh'] = False
try:
if cl_args.helper:
builders = [helper_image]
@@ -235,7 +243,7 @@
builders = [helper_image, main_image]
for builder in builders:
builder(target_image_namespace, archs, push=push)
builder(target_image_namespace, archs, push=push, **opts)
finally:
if push:
docker_logout(registry)
Loading