use kubectl wait
This commit is contained in:
@ -5,20 +5,12 @@ inputs:
|
|||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
|
env:
|
||||||
|
POD_NAME: ${{ inputs.service_name }}
|
||||||
|
APP_NAME: ${{ inputs.service_name }}
|
||||||
|
SERVICE_NAME: ${{ inputs.service_name }}
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: curl -s https://gitea.vecus.ru/ci/postgres-actions/raw/branch/master/.gitea/actions/create/postgres-template.yaml | envsubst | werf kubectl apply -f -
|
||||||
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
|
||||||
echo "Waiting for pod to be ready..."
|
- run: werf kubectl wait --for=condition=ready pod/${POD_NAME} --timeout=60s
|
||||||
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
|
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
POD_NAME: ${{ inputs.service_name }}
|
|
||||||
APP_NAME: ${{ inputs.service_name }}
|
|
||||||
SERVICE_NAME: ${{ inputs.service_name }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user