From 2bac2856538129f7d407c01c0eba2f2b59adc9d9 Mon Sep 17 00:00:00 2001 From: Valentin Afanasev Date: Wed, 6 Aug 2025 22:13:06 +0300 Subject: [PATCH] use kubectl wait --- .gitea/actions/create/action.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.gitea/actions/create/action.yml b/.gitea/actions/create/action.yml index 09c96a1..e9140b8 100644 --- a/.gitea/actions/create/action.yml +++ b/.gitea/actions/create/action.yml @@ -5,20 +5,12 @@ inputs: runs: using: composite + env: + POD_NAME: ${{ inputs.service_name }} + APP_NAME: ${{ inputs.service_name }} + SERVICE_NAME: ${{ inputs.service_name }} steps: - - run: | - curl -s https://gitea.vecus.ru/ci/postgres-actions/raw/branch/master/.gitea/actions/create/postgres-template.yaml | envsubst | werf kubectl apply -f - - echo "Waiting for pod to be ready..." - timeout=600 - set +e - while ! werf kubectl get pod ${POD_NAME} -o jsonpath='{.status.containerStatuses[0].ready}' 2>/dev/null | grep -q true; do - echo "Still not ready..." - sleep 2 - timeout=$((timeout - 2)) - [[ ${timeout} -le 0 ]] && echo "Timeout waiting for pod" && exit 10 - done + - run: curl -s https://gitea.vecus.ru/ci/postgres-actions/raw/branch/master/.gitea/actions/create/postgres-template.yaml | envsubst | werf kubectl apply -f - + shell: bash + - run: werf kubectl wait --for=condition=ready pod/${POD_NAME} --timeout=60s shell: bash - env: - POD_NAME: ${{ inputs.service_name }} - APP_NAME: ${{ inputs.service_name }} - SERVICE_NAME: ${{ inputs.service_name }}