From aa088572d3721837d08556634961c5c7d86814c1 Mon Sep 17 00:00:00 2001 From: Yikun Jiang Date: Wed, 9 Aug 2023 15:46:47 +0800 Subject: [PATCH] fix: recover --docker-base-image feature (#906) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the https://github.com/bioconda/bioconda-utils/pull/866 we introduced the `--docker-base-image` to help user to specify customized build docker image (such as Linux aarch64 build). But we noticed that it doesn’t work after the https://github.com/bioconda/bioconda-utils/pull/894 , because a local var introduced and the `docker-base-image` arguments is ignored. This PR try to recover it, if user specify the `--docker-base-image`, it will be used directly otherwise use the local var. Test: ``` [root@kunpeng bioconda-recipes]# bioconda-utils build --docker --packages bamstats --docker-base-image ghcr.io/yikun/bioconda-utils-build-env-cos7-aarch64 11:50:12 BIOCONDA INFO Considering total of 1 recipes (bamstats). 11:50:12 BIOCONDA INFO Processing 1 recipes (bamstats). 11:50:12 BIOCONDA WARNING Using tag 2.3.4 for docker image, since there is no image for a not yet release version (2.3.4+0.g9a85115.dirty). 11:50:12 BIOCONDA INFO Using docker image ghcr.io/yikun/bioconda-utils-build-env-cos7-aarch64 for building. // ... ... ``` Signed-off-by: Yikun Jiang --- bioconda_utils/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bioconda_utils/cli.py b/bioconda_utils/cli.py index 917d463fc9..5fc9a8817d 100644 --- a/bioconda_utils/cli.py +++ b/bioconda_utils/cli.py @@ -465,7 +465,7 @@ def build(recipe_folder, config, packages="*", git_range=None, testonly=False, logger.warning(f"Using tag {image_tag} for docker image, since there is no image for a not yet release version ({VERSION}).") else: image_tag = VERSION - docker_base_image = f"quay.io/bioconda/bioconda-utils-build-env-cos7:{image_tag}" + docker_base_image = docker_base_image or f"quay.io/bioconda/bioconda-utils-build-env-cos7:{image_tag}" logger.info(f"Using docker image {docker_base_image} for building.") docker_builder = docker_utils.RecipeBuilder(