diff --git a/ci/docs.sh b/ci/docs.sh index 4dcb0319507bfd98741d8326c24ed2ccae9942d4..79440bbf8ce7800f471a265c6f830c397e310fa1 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 8d67c0d4c1d5e84c08cd5f26adf91e6806d867aa..399a548469cc828a64d1f866c7a5cf2b82416357 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