Skip to content

Commit

Permalink
Update promote-env.yml - wait for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-benoit authored Aug 1, 2024
1 parent 042d7ac commit 00a9d7c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/promote-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,30 @@ jobs:
--org ${{ secrets.HUMANITEC_ORG }} \
--app ${{ vars.APP_NAME }}
fi
- name: wait for deployment
run: |
sleep 1
IS_DONE=false
CURRENT_STATUS=""
while [ "$IS_DONE" = false ]; do
CURRENT_STATUS=$(humctl get deployment . -o json \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ secrets.HUMANITEC_ORG }} \
--app ${{ vars.APP_NAME }} \
--env ${{ github.event.inputs.environment }} \
| jq -r .status.status)
if [ "$CURRENT_STATUS" = "in progress" ]; then
echo "Deployment still in progress..."
sleep 1
elif [ "$CURRENT_STATUS" = "failed" ]; then
echo "Deployment failed!"
IS_DONE=true
else
echo "Deployment successfully completed!"
IS_DONE=true
fi
done
echo $CURRENT_STATUS
if [ "$CURRENT_STATUS" = "failed" ]; then
exit 1
fi

0 comments on commit 00a9d7c

Please sign in to comment.