Skip to content

Commit

Permalink
Simplified restart script
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Mar 29, 2023
1 parent c7487c6 commit c495316
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions 160_gitlab_ci/000_rollout/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ while ! docker compose exec -T gitlab \
done
echo "GitLab ready after ${SECONDS} second(s)"

echo
echo "### Creating PAT for root on seat ${SEAT_INDEX}"
ROOT_TOKEN="$(openssl rand -hex 32)"
# TODO: Store token locally and reuse
if ! docker compose exec -T gitlab \
curl \
--url http://localhost/api/v4/user \
--silent \
--fail \
--output /dev/null \
--header "Private-Token: ${ROOT_TOKEN}"; then
docker compose exec -T gitlab \
gitlab-rails runner -e production "user = User.find_by_username('root'); token = user.personal_access_tokens.create(scopes: [:api, :read_api, :read_user, :read_repository, :write_repository, :sudo], name: 'almighty'); token.set_token('${ROOT_TOKEN}'); token.save!"
fi

echo
echo "### Retrieving runner registration token on seat ${SEAT_INDEX}"
export REGISTRATION_TOKEN="$(
Expand Down

0 comments on commit c495316

Please sign in to comment.