From 5fc4963f7c20d1739fbea0cc1a7ca3b5fa813f90 Mon Sep 17 00:00:00 2001 From: ange Date: Sun, 22 Dec 2024 06:33:27 +0000 Subject: [PATCH] fix: runner token not generated on first deploy --- manifests/bin/createadmin.sh | 2 +- manifests/bin/deploy.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/bin/createadmin.sh b/manifests/bin/createadmin.sh index 477095a..3b2d301 100755 --- a/manifests/bin/createadmin.sh +++ b/manifests/bin/createadmin.sh @@ -1,7 +1,7 @@ #!/bin/bash -e function get_token() { - kubectl exec app-0 -- gitea admin user generate-access-token \ + kubectl exec statefulset/app -- gitea admin user generate-access-token \ --username "$name" \ --token-name "${name^^}" \ --scopes "$scopes" \ diff --git a/manifests/bin/deploy.sh b/manifests/bin/deploy.sh index 8198027..7947f4d 100755 --- a/manifests/bin/deploy.sh +++ b/manifests/bin/deploy.sh @@ -62,13 +62,14 @@ kapply common/job.yaml \ kubectl rollout restart statefulset app +kubectl rollout status statefulset app kubectl wait --timeout=5m --for=condition=complete job/migrate ./manifests/bin/createadmin.sh gitea ./manifests/bin/createadmin.sh renovate 'write:repository,read:user,write:issue,read:organization' kcreatesec runner \ - --from-literal=token="$(kgseckey runner token || kubectl exec app-0 -- gitea actions generate-runner-token)" + --from-literal=token="$(kgseckey runner token || kubectl exec statefulset/app -- gitea actions generate-runner-token)" kapply common/runner.yaml common/renovate.yaml