From ae95051b33cbbbe0bf544529cb913c8c14c8ae68 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Tue, 16 Jan 2018 12:38:19 +0100
Subject: [PATCH] Simplify more the build stage

---
 gitlab/before_build.sh | 10 ++++++----
 gitlab/build.sh        | 11 +----------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/gitlab/before_build.sh b/gitlab/before_build.sh
index df6b9a1..79b20d3 100755
--- a/gitlab/before_build.sh
+++ b/gitlab/before_build.sh
@@ -30,12 +30,14 @@ run_cmd ${CONDA_FOLDER}/bin/conda config --set always_yes yes --set changeps1 no
 run_cmd ${CONDA_FOLDER}/bin/conda config --set always_yes true
 run_cmd ${CONDA_FOLDER}/bin/conda config --set show_channel_urls true
 run_cmd ${CONDA_FOLDER}/bin/conda config --set anaconda_upload no
-run_cmd ${CONDA_FOLDER}/bin/conda config --add channels ${CHANNEL_URL}
+run_cmd ${CONDA_FOLDER}/bin/conda config --add channels ${CONDA_CHANNEL}
+if [ -z "${CI_COMMIT_TAG}" ]; then
+  run_cmd ${CONDA_FOLDER}/bin/conda config --add channels ${CONDA_BETA_CHANNEL}
+fi
 run_cmd ${CONDA_FOLDER}/bin/conda config --set ssl_verify false
-run_cmd ${CONDA_FOLDER}/bin/conda install --quiet --yes -c defaults python conda=4.4 curl conda-build=3
 
-# copies our central build configuration to the conda folder of the package
-run_cmd cp _ci/conda_build_config.yaml conda/
+# updates conda installation
+run_cmd ${CONDA_FOLDER}/bin/conda install --quiet --yes python conda=4.4 curl conda-build=3
 
 # cleans up
 run_cmd ${CONDA_FOLDER}/bin/conda clean --lock
diff --git a/gitlab/build.sh b/gitlab/build.sh
index cb8f040..a953aa9 100755
--- a/gitlab/build.sh
+++ b/gitlab/build.sh
@@ -19,16 +19,7 @@ fi
 BOB_BUILD_NUMBER=`head -n 1 ./_ci/${OS_SLUG}/${PYTHON_VERSION}/build_number.txt | tr -d '\n'`
 export_env BOB_BUILD_NUMBER
 
-if [ -z "${CI_COMMIT_TAG}" ]; then
-    run_cmd ${CONDA_FOLDER}/bin/conda build --quiet --override-channels -c ${CONDA_BETA_CHANNEL} -c ${CONDA_CHANNEL} -c https://repo.continuum.io/pkgs/main -c https://repo.continuum.io/pkgs/free -c https://repo.continuum.io/pkgs/r -c https://repo.continuum.io/pkgs/pro --python=${PYTHON_VERSION} conda
-else
-    run_cmd ${CONDA_FOLDER}/bin/conda build --quiet --override-channels -c ${CONDA_CHANNEL} -c https://repo.continuum.io/pkgs/main -c https://repo.continuum.io/pkgs/free -c https://repo.continuum.io/pkgs/r -c https://repo.continuum.io/pkgs/pro --python=${PYTHON_VERSION} conda
-fi
+run_cmd ${CONDA_FOLDER}/bin/conda build --variant-config-files _ci/conda_build_config.yaml --quiet --python=${PYTHON_VERSION} conda
 
 # Move the cache to conda env folder to cache it
-if [ "${OSNAME}" == "linux" ]; then
-    mkdir -p ${CONDA_ENVS_PATH}/.pkgs
-    touch ${CONDA_ENVS_PATH}/.pkgs/urls
-    touch ${CONDA_ENVS_PATH}/.pkgs/urls.txt
-fi
 merge_conda_cache ${CONDA_ENVS_PATH}/.pkgs ${CONDA_FOLDER}/pkgs
-- 
GitLab