diff --git a/cleanup.sh b/cleanup.sh index a855171..d87a08a 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $current_dir/base.sh # Get variables from base. +source $current_dir/variables.sh # Get variables from variables. info "Deleting container $CONTAINER_ID" diff --git a/run.sh b/run.sh index 33a538e..4e766e0 100755 --- a/run.sh +++ b/run.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $current_dir/base.sh # Get variables from base. +source $current_dir/variables.sh # Get variables from variables. case ${2} in prepare_script) diff --git a/utils.sh b/utils.sh index 348945e..0f7f18a 100755 --- a/utils.sh +++ b/utils.sh @@ -1,43 +1,7 @@ #!/usr/bin/env bash current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $current_dir/base.sh # Get variables from base. - -readonly NORMAL=$(printf '\033[0m') -readonly BOLD=$(printf '\033[1m') -readonly faint=$(printf '\033[2m') -readonly UNDERLINE=$(printf '\033[4m') -readonly NEGATIVE=$(printf '\033[7m') -readonly RED=$(printf '\033[31m') -readonly GREEN=$(printf '\033[32m') -readonly ORANGE=$(printf '\033[33m') -readonly BLUE=$(printf '\033[34m') -readonly YELLOW=$(printf '\033[93m') -readonly WHITE=$(printf '\033[39m') - -function success() -{ - local msg=${1} - echo "[${BOLD}${GREEN} OK ${NORMAL}] ${msg}" -} - -function info() -{ - local msg=${1} - echo "[${BOLD}${BLUE}INFO${NORMAL}] ${msg}" -} - -function warn() -{ - local msg=${1} - echo "[${BOLD}${ORANGE}WARN${NORMAL}] ${msg}" 2>&1 -} - -function error() -{ - local msg=${1} - echo "[${BOLD}${RED}FAIL${NORMAL}] ${msg}" 2>&1 -} +source $current_dir/variables.sh # Get variables from variables. clean_containers() { diff --git a/base.sh b/variables.sh similarity index 86% rename from base.sh rename to variables.sh index f8a91f6..ae04791 100755 --- a/base.sh +++ b/variables.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source $current_dir/prints.sh # Get variables from variables. + # All Variables here: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference, strating with CUSTOM_ENV_ CONTAINER_ID="runner-$CUSTOM_ENV_CI_RUNNER_ID-project-$CUSTOM_ENV_CI_PROJECT_ID-concurrent-$CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID-$CUSTOM_ENV_CI_JOB_ID" @@ -11,7 +14,7 @@ DEBIAN_VERSION=$(echo $CUSTOM_ENV_CI_COMMIT_REF_NAME | cut -d'-' -f1) # CUSTOM_E if [ -z "$DEBIAN_VERSION" ] || [ "$DEBIAN_VERSION" != "stretch" ] && [ "$DEBIAN_VERSION" != "buster" ] then DEBIAN_VERSION="$(echo $CUSTOM_ENV_CI_DEFAULT_BRANCH | cut -d'-' -f1)" # stretch-unstable, buster-unstable... - info "Use the default debian version: $DEBIAN_VERSION" + echo "Use the default debian version: $DEBIAN_VERSION" fi SNAPSHOT_NAME="$CUSTOM_ENV_CI_JOB_IMAGE" if [ -z "$SNAPSHOT_NAME" ]