Skip to content

fix: repair errors in startup shell script #1087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 15, 2024
Merged
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
8 changes: 5 additions & 3 deletions template/gitlab-runner.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ then
# fetch gitlab token from SSM
gitlab_token=$(aws ssm get-parameter --name "${secure_parameter_store_gitlab_token_name}" --with-decryption --region "${secure_parameter_store_region}" | jq -r ".Parameter | .Value")

response = $(curl ${curl_cacert} --request POST -L "${runners_gitlab_url}/api/v4/user/runners" \
response=$(curl ${curl_cacert} --request POST -L "${runners_gitlab_url}/api/v4/user/runners" \
--header "private-token: $gitlab_token" \
--form "tag_list=${gitlab_runner_tag_list}" \
--form "description=${gitlab_runner_description}" \
Expand All @@ -60,10 +60,12 @@ then
$runner_type_param \
--form "access_level=${gitlab_runner_access_level}")

token = $(echo response | jq -r '.token')
token=$(echo $response | jq -r '.token')
if [[ "$token" == null ]]
message = $(echo response | jq -r '.message // .error_description')
then
message=$(echo $response | jq -r '.message // .error_description')
if [[ "$message" != null ]]
then
echo "ERROR: Couldn't register the Runner. GitLab API call returned $message".
exit 1
fi
Expand Down