From 27dac7465f437b487bfa858aad810749a3cbea99 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Thu, 5 Apr 2018 14:11:02 +0200
Subject: [PATCH] Closes #64 with a better fix

---
 gitlab/functions.sh | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index cc0b5a4..e4a321c 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -356,23 +356,27 @@ install_miniconda() {
 # given the current visibility/tagging conditions of the package.
 set_conda_channels() {
   CONDA_CHANNELS=() #resets bash array
-  if [ -z "${2}" ]; then
-    # there are no tags on this build - add beta channels
-    if [ "${1}" == "private" ]; then
-      # adds private beta builds (only if the package is also private)
+  if [ "${1}" == "public" ]; then
+    if [ -z "${2}" ]; then #public beta build
+      CONDA_CHANNELS+=('public/conda/label/beta')
+      CONDA_CHANNELS+=('public/conda')
+    else #public staging (tagged) build
+      CONDA_CHANNELS+=('public/conda/label/staging')
+      CONDA_CHANNELS+=('public/conda')
+    fi
+  else
+    if [ -z "${2}" ]; then #private beta build
       CONDA_CHANNELS+=('private/conda/label/beta')
+      CONDA_CHANNELS+=('public/conda/label/beta')
+      CONDA_CHANNELS+=('private/conda')
+      CONDA_CHANNELS+=('public/conda')
+    else #private staging (tagged) build
+      CONDA_CHANNELS+=('private/conda/label/staging')
+      CONDA_CHANNELS+=('public/conda/label/staging')
+      CONDA_CHANNELS+=('private/conda')
+      CONDA_CHANNELS+=('public/conda')
     fi
-    # adds public stable builds (always)
-    CONDA_CHANNELS+=('public/conda/label/beta')
-  fi
-  if [ "${1}" == "private" ]; then
-    # adds private stable builds (only if the package is also private)
-    CONDA_CHANNELS+=('private/conda/label/stable')
-    CONDA_CHANNELS+=('private/conda')
   fi
-  # adds public stable builds (always)
-  CONDA_CHANNELS+=('public/conda/label/stable')
-  CONDA_CHANNELS+=('public/conda')
   check_array_env CONDA_CHANNELS
 }
 
-- 
GitLab