Commit 2ef4b2d4 authored by Duncan Macleod's avatar Duncan Macleod

ci: resolved conda activate warnings

parent c4f1e0c7
Pipeline #59441 passed with stages
in 61 minutes and 18 seconds
......@@ -13,16 +13,17 @@ variables:
CVMFS_REPO: "ligo-containers.opensciencegrid.org"
CVMFS_PATH: "/cvmfs/${CVMFS_REPO}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}"
DOCKER_DRIVER: "overlay"
MINICONDA_PATH: "${CI_PROJECT_DIR}/miniconda"
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
TAG: "latest"
.install-miniconda-osx: &install-miniconda-osx |
curl -o ./miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
/bin/bash miniconda.sh -b -u -p ${MINICONDA_PATH}
source ${MINICONDA_PATH}/etc/profile.d/conda.sh
/bin/bash miniconda.sh -b -u -p ${CONDA_PATH:=${CI_PROJECT_DIR}/miniconda}
.update-conda: &update-conda |
.init-conda: &init-conda |
source "${CONDA_PATH:-/opt/conda}/etc/profile.d/conda.sh"
conda config --set always_yes yes
conda config --add channels conda-forge
conda update --name base --channel defaults --yes conda
.docker-login: &docker-login |
......@@ -48,14 +49,14 @@ variables:
.render: &render
stage: render
before_script:
- *init-conda
script:
- export OS_NAME="${CI_JOB_NAME#render:}"
- conda activate base || source activate base
- conda config --add channels conda-forge
- conda activate base
- conda install --yes --file requirements.txt
- python3 ./scripts/build-environments.py
-m ./lscsoft_conda_config.yaml
-o environments/${OS_NAME}
-o environments/${CI_JOB_NAME#render:}
packages
artifacts:
paths:
......@@ -78,20 +79,20 @@ render:osx:
- macos_highsierra
before_script:
- *install-miniconda-osx
- *update-conda
- *init-conda
# -- build-and-test ---------
.build-and-test: &build-and-test
stage: build-and-test
before_script:
- *update-conda
- *init-conda
script:
- export ENV_PATH="$(pwd)/environments/${CI_JOB_NAME#build-and-test:}"
# build
- |
for ymlf in ${ENV_PATH}/*.yaml; do
conda env create -f ${ymlf};
conda env create --file ${ymlf};
done
# copy test files into place
- mkdir -pv test
......@@ -107,7 +108,7 @@ render:osx:
- |
for ymlf in ${ENV_PATH}/*.yaml; do
NAME=$(basename ${ymlf} .yaml);
conda activate ${NAME} || source activate ${NAME};
conda activate ${NAME};
python ${ENV_PATH}/${NAME}-test-imports.py;
bash ${ENV_PATH}/${NAME}-test-commands.sh;
done
......@@ -127,7 +128,7 @@ build-and-test:osx:
- render:osx
before_script:
- *install-miniconda-osx
- *update-conda
- *init-conda
build-and-test:cvmfs-container:
<<: *docker-job
......
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