Skip to content
Snippets Groups Projects
Commit c8c2ab24 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Install yum_requirements.txt in all cases in the CI

parent 64bd7471
No related branches found
No related tags found
1 merge request!259Install yum_requirements.txt in all cases in the CI
Pipeline #55297 passed
This commit is part of merge request !259. Comments created here will be created in the context of that merge request.
......@@ -84,7 +84,6 @@ build_linux_38:
PYTHON_VERSION: "3.8"
BUILD_EGG: "true"
script:
- if [ -f "${CI_PROJECT_DIR}/conda/yum_requirements.txt" ]; then /usr/bin/sudo -n yum -y install $(cat ${CI_PROJECT_DIR}/conda/yum_requirements.txt); fi # [linux]
- bdt ci build -vv
- bdt ci readme -vv dist/*.zip
- bdt ci clean -vv
......
......@@ -8,7 +8,7 @@ import click
import conda_build.api
import yaml
from ..bootstrap import get_channels, set_environment
from ..bootstrap import get_channels, run_cmdline, set_environment
from ..build import (
conda_arch,
get_docserver_setup,
......@@ -248,6 +248,18 @@ def build(
if not os.path.exists(d):
raise RuntimeError("The directory %s does not exist" % d)
# If in docker, install the packages inside the yum_requirements.txt file if it exists
yum_requirements_file = os.path.join(d, "yum_requirements.txt")
if "docker" in os.environ.get("CI_RUNNER_TAGS", "") and os.path.exists(
yum_requirements_file
):
logger.info(
"Installing packages from yum_requirements.txt file using yum"
)
cmd = ["/usr/bin/sudo", "-n", "yum", "-y", "install"]
cmd.extend(open(yum_requirements_file).read().splitlines())
run_cmdline(cmd)
version_candidate = os.path.join(d, "..", "version.txt")
if os.path.exists(version_candidate):
version = open(version_candidate).read().rstrip()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment