Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions templates/scripts/ci_releases/setup_repo_for_writing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ if [[ ( -z $GITLAB_PROJECT_RW_AND_API_TOKEN ) ]]; then
exit 1
fi

IFS=':' read -ra GITLAB_PROJECT_VALIDATE <<< "${GITLAB_PROJECT_RW_AND_API_TOKEN}"
if [[ "${#GITLAB_PROJECT_VALIDATE[@]}" -ne 2 ]]; then
echo "The GITLAB_PROJECT_RW_AND_API_TOKEN variable is not valid. It should be in the form of <user_name>:<token>."
exit 1
fi

git config user.email "${GITLAB_USER_EMAIL:-spark_ci_script@sparkfabrik.com}"
git config user.name "${GITLAB_USER_NAME:-Spark CI script}"
NEWREMOTEURL=$(echo "$CI_REPOSITORY_URL" | sed -e "s|.*@\(.*\)|$CI_SERVER_PROTOCOL://$GITLAB_PROJECT_RW_AND_API_TOKEN@\1|")
Expand Down