feat: retry RUNNER_TOKEN while null
This commit is contained in:
parent
234bc3d169
commit
9d0038df00
@ -60,9 +60,13 @@ kapply common/job.yaml \
|
||||
|
||||
kubectl rollout restart statefulset app
|
||||
|
||||
RUNNER_TOKEN="$(curl "http://$GITEA_USERNAME:$GITEA_PASSWORD@app/api/v1/admin/runners/registration-token" | jq .token || true)"
|
||||
if [ -n "$RUNNER_TOKEN" ]; then
|
||||
kcreatesec runner-secret --from-literal=token="$RUNNER_TOKEN"
|
||||
kapply common/runner.yaml
|
||||
kubectl rollout restart statefulset runner
|
||||
fi
|
||||
for i in {0..9}; do
|
||||
RUNNER_TOKEN="$(curl "http://$GITEA_USERNAME:$GITEA_PASSWORD@app/api/v1/admin/runners/registration-token" | jq .token)"
|
||||
|
||||
if [ "$RUNNER_TOKEN" != null ]; then
|
||||
kcreatesec runner-secret --from-literal=token="$RUNNER_TOKEN"
|
||||
kapply common/runner.yaml
|
||||
kubectl rollout restart statefulset runner
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user