Skip to content
Snippets Groups Projects
Commit ec8f5f85 authored by Lukas Werner's avatar Lukas Werner
Browse files

Fixed error messages

parent 2df9c541
Branches
No related tags found
No related merge requests found
......@@ -25,8 +25,8 @@ function error {
## User authentication
[ -z "$CUSTOM_ENV_AUTH_USER" ] && error "AUTH_USER CI/CD variable has not been set."
[ -z "$CUSTOM_ENV_AUTH_KEY" ] && error "AUTH_KEY secret CI/CD variable has not been set."
[ -z "${CUSTOM_ENV_AUTH_USER:+x}" ] && error "AUTH_USER CI/CD variable has not been set."
[ -z "${CUSTOM_ENV_AUTH_KEY:+x}" ] && error "AUTH_KEY secret CI/CD variable has not been set."
AUTH_USER=$CUSTOM_ENV_AUTH_USER
......@@ -50,7 +50,7 @@ exit 1
AUTH_USER_WORK=$(runuser "$AUTH_USER" --login --command "echo \$WORK")
[ -z "$AUTH_USER_WORK" ] && error "Could not determine $AUTH_USER's \$WORK directory."
[ -z "${AUTH_USER_WORK:+x}" ] && error "Could not determine $AUTH_USER's \$WORK directory."
BASE_DIR=$AUTH_USER_WORK/gitlab-runner/builds/${CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID:?}/${CUSTOM_ENV_CI_PROJECT_NAMESPACE:?}/${CUSTOM_ENV_CI_PROJECT_NAME:?}
......
......@@ -8,14 +8,14 @@ TXT_GREEN="\e[32m"
TXT_CLEAR="\e[0m"
TXT_BOLD="\e[1m"
[ -z "$CUSTOM_ENV_AUTH_USER" ] && error "AUTH_USER CI/CD variable has not been set."
[ -z "$CUSTOM_ENV_AUTH_KEY" ] && error "AUTH_KEY secret CI/CD variable has not been set."
[ -z "${CUSTOM_ENV_AUTH_USER:+x}" ] && error "AUTH_USER CI/CD variable has not been set."
[ -z "${CUSTOM_ENV_AUTH_KEY:+x}" ] && error "AUTH_KEY secret CI/CD variable has not been set."
AUTH_USER=$CUSTOM_ENV_AUTH_USER
AUTH_USER_WORK=$(runuser "$AUTH_USER" --login --command "echo \$WORK")
[ -z "$AUTH_USER_WORK" ] && error "Could not determine $AUTH_USER's \$WORK directory."
[ -z "${AUTH_USER_WORK:+x}" ] && error "Could not determine $AUTH_USER's \$WORK directory."
cat << EOS
{
......
......@@ -30,8 +30,8 @@ function error {
## User authentication
[ -z "$CUSTOM_ENV_AUTH_USER" ] && error "AUTH_USER CI/CD variable has not been set."
[ -z "$CUSTOM_ENV_AUTH_KEY" ] && error "AUTH_KEY secret CI/CD variable has not been set."
[ -z "${CUSTOM_ENV_AUTH_USER:+x}" ] && error "AUTH_USER CI/CD variable has not been set."
[ -z "${CUSTOM_ENV_AUTH_KEY:+x}" ] && error "AUTH_KEY secret CI/CD variable has not been set."
AUTH_USER=$CUSTOM_ENV_AUTH_USER
......@@ -57,7 +57,7 @@ AUTH_USER_HOME=$(getent passwd "$AUTH_USER" | awk -F ":" '{print $6}')
AUTH_USER_SHELL=$(getent passwd "$AUTH_USER" | awk -F ":" '{print $7}')
AUTH_USER_WORK=$(runuser "$AUTH_USER" --login --command "echo \$WORK")
[ -z "$AUTH_USER_WORK" ] && error "Could not determine $AUTH_USER's \$WORK directory."
[ -z "${AUTH_USER_WORK:+x}" ] && error "Could not determine $AUTH_USER's \$WORK directory."
chown -R "$AUTH_USER" "$TMPDIR"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment