From 510dbda38afcb23f8c66066d78588c3068bbf2eb Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Wed, 21 Sep 2016 14:35:15 +0200
Subject: [PATCH] Colorize remaining ci commands

---
 ci/docs.sh   | 15 ++++++++++++---
 ci/wheels.sh | 15 ++++++++++++---
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/ci/docs.sh b/ci/docs.sh
index 4dcb031..79440bb 100755
--- a/ci/docs.sh
+++ b/ci/docs.sh
@@ -1,8 +1,17 @@
 #!/usr/bin/env bash
 # Wed 21 Sep 2016 13:08:05 CEST
 
+# Functions for coloring echo commands
+red_echo() {
+  echo -e "\033[1;31m${@}\033[0m"
+}
+
+green_echo() {
+  echo -e "\033[1;32m${@}\033[0m"
+}
+
 if [ -z "${DOCUSER}" ] || [ -z "${DOCPASS}" ] || [ -z "${DOCSERVER}" ]; then
-  echo "DOCSERVER, DOCUSER and/or DOCPASS undefined - cannot upload";
+  red_echo "DOCSERVER, DOCUSER and/or DOCPASS undefined - aborting...";
   exit 1
 fi
 
@@ -18,9 +27,9 @@ echo "runner=${CI_RUNNER_DESCRIPTION}" >> ${info}
 file=${CI_PROJECT_NAME}-${CI_BUILD_REF}.tar.bz2
 tar cfj ${file} sphinx
 
-echo "[>>] Uploading ${file}..."
+green_echo "[>>] Uploading ${file}..."
 curl --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${file} ${DOCSERVER}/software/bob/docs-upload/
 if [ $? != 0 ]; then
-  echo "[error] curl command finished with an error condition"
+  red_echo "[error] curl command finished with an error condition"
   exit 1
 fi
diff --git a/ci/wheels.sh b/ci/wheels.sh
index 8d67c0d..399a548 100755
--- a/ci/wheels.sh
+++ b/ci/wheels.sh
@@ -1,16 +1,25 @@
 #!/usr/bin/env bash
 # Wed 21 Sep 2016 13:06:56 CEST
 
+# Functions for coloring echo commands
+red_echo() {
+  echo -e "\033[1;31m${@}\033[0m"
+}
+
+green_echo() {
+  echo -e "\033[1;32m${@}\033[0m"
+}
+
 if [ -z "${DOCUSER}" ] || [ -z "${DOCPASS}" ] || [ -z "${DOCSERVER}" ]; then
-  echo "DOCSERVER, DOCUSER and/or DOCPASS undefined - cannot upload";
+  red_echo "DOCSERVER, DOCUSER and/or DOCPASS undefined - aborting...";
   exit 1
 fi
 
 for file in dist/*.whl; do
-  echo "[>>] Uploading ${file}..."
+  green_echo "[>>] Uploading ${file}..."
   curl --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${file} ${DOCSERVER}/software/bob/wheels-upload/gitlab/
   if [ $? != 0 ]; then
-    echo "[error] curl command finished with an error condition"
+    red_echo "[error] curl command finished with an error condition"
     exit 1
   fi
 done
-- 
GitLab