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

Merge branch 'yum_requirements.txt' into 'master'

Install yum_requirements.txt in all cases in the CI

Closes #82

See merge request !259
parents 64bd7471 c8c2ab24
No related branches found
No related tags found
1 merge request!259Install yum_requirements.txt in all cases in the CI
Pipeline #55298 passed
...@@ -84,7 +84,6 @@ build_linux_38: ...@@ -84,7 +84,6 @@ build_linux_38:
PYTHON_VERSION: "3.8" PYTHON_VERSION: "3.8"
BUILD_EGG: "true" BUILD_EGG: "true"
script: 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 build -vv
- bdt ci readme -vv dist/*.zip - bdt ci readme -vv dist/*.zip
- bdt ci clean -vv - bdt ci clean -vv
......
...@@ -8,7 +8,7 @@ import click ...@@ -8,7 +8,7 @@ import click
import conda_build.api import conda_build.api
import yaml import yaml
from ..bootstrap import get_channels, set_environment from ..bootstrap import get_channels, run_cmdline, set_environment
from ..build import ( from ..build import (
conda_arch, conda_arch,
get_docserver_setup, get_docserver_setup,
...@@ -248,6 +248,18 @@ def build( ...@@ -248,6 +248,18 @@ def build(
if not os.path.exists(d): if not os.path.exists(d):
raise RuntimeError("The directory %s does not exist" % 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") version_candidate = os.path.join(d, "..", "version.txt")
if os.path.exists(version_candidate): if os.path.exists(version_candidate):
version = open(version_candidate).read().rstrip() version = open(version_candidate).read().rstrip()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment