From 7ccd43dcb2a5bc90783536b183dfec1c062ebcbf Mon Sep 17 00:00:00 2001 From: Amir MOHAMMADI <amir.mohammadi@idiap.ch> Date: Fri, 22 Sep 2017 13:24:58 +0200 Subject: [PATCH] install conda only in build stage --- gitlab/functions.sh | 7 +++++-- templates/gitlab-ci.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gitlab/functions.sh b/gitlab/functions.sh index 949626a..9ccd6f1 100644 --- a/gitlab/functions.sh +++ b/gitlab/functions.sh @@ -343,9 +343,12 @@ if [ -z "${CONDA_FOLDER}" ]; then CONDA_FOLDER=/opt/miniconda fi -# check if a conda installation exists. Otherwise, install one: +# check if a conda installation exists. Otherwise, install one (only in build +# stage): if [ ! -e ${CONDA_FOLDER}/bin/conda ]; then - install_miniconda ${CONDA_FOLDER} + if [ "${CI_JOB_STAGE}" == "build" ]; then + install_miniconda ${CONDA_FOLDER} + fi fi PYVER=py$(echo ${PYTHON_VERSION} | tr -d '.') diff --git a/templates/gitlab-ci.yml b/templates/gitlab-ci.yml index 1bfbb4f..edbeeb1 100644 --- a/templates/gitlab-ci.yml +++ b/templates/gitlab-ci.yml @@ -17,7 +17,7 @@ stages: .build_template: &build_job stage: build before_script: - - export PATH=${CONDA_FOLDER}:$PATH + - export PATH=$CONDA_FOLDER:$PATH - mkdir _ci - curl https://curl.haxx.se/ca/cacert.pem > _ci/cacert.pem - export CURL_CA_BUNDLE=`pwd`/_ci/cacert.pem -- GitLab