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
|
kubectl rollout restart statefulset app
|
||||||
|
|
||||||
RUNNER_TOKEN="$(curl "http://$GITEA_USERNAME:$GITEA_PASSWORD@app/api/v1/admin/runners/registration-token" | jq .token || true)"
|
for i in {0..9}; do
|
||||||
if [ -n "$RUNNER_TOKEN" ]; then
|
RUNNER_TOKEN="$(curl "http://$GITEA_USERNAME:$GITEA_PASSWORD@app/api/v1/admin/runners/registration-token" | jq .token)"
|
||||||
kcreatesec runner-secret --from-literal=token="$RUNNER_TOKEN"
|
|
||||||
kapply common/runner.yaml
|
if [ "$RUNNER_TOKEN" != null ]; then
|
||||||
kubectl rollout restart statefulset runner
|
kcreatesec runner-secret --from-literal=token="$RUNNER_TOKEN"
|
||||||
fi
|
kapply common/runner.yaml
|
||||||
|
kubectl rollout restart statefulset runner
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user