Skip to content

Commit

Permalink
ci: use latest condition to check emqx status
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory-Z committed Aug 3, 2022
1 parent 7a66aef commit a331ed5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/actions/deploy-emqx/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ runs:
shell: bash
run: |
while
[ -z "$(kubectl get ${{ inputs.kind }} ${{ inputs.name }} -o json | jq '.status.conditions[] | select((.type == "Running") and (.status == "True"))')" ];
condition="$(kubectl get ${{ inputs.kind }} ${{ inputs.name }} -o json | jq '.status.conditions[0]')";
[[ "$condition" == "null" ]] \
|| [[ "$(echo $condition | jq --raw-output '.type')" != "Running" ]] \
|| [[ "$(echo $condition | jq --raw-output '.status')" != "True" ]]
do
echo "waiting ${{ inputs.name}}"
echo "waiting"
sleep 1
done
done
14 changes: 10 additions & 4 deletions .github/workflows/upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ jobs:
timeout-minutes: 5
run: |
while
[ -z "$(kubectl get ${{ matrix.emqx[0] }} emqx -o json | jq '.status.conditions[] | select((.type == "Running") and (.status == "True"))')" ];
condition="$(kubectl get ${{ matrix.emqx[0] }} emqx -o json | jq '.status.conditions[0]')";
[[ "$condition" == "null" ]] \
|| [[ "$(echo $condition | jq --raw-output '.type')" != "Running" ]] \
|| [[ "$(echo $condition | jq --raw-output '.status')" != "True" ]]
do
echo "waiting ${{ matrix.emqx[0] }}"
echo "waiting"
sleep 1
done
- name: Build image
Expand Down Expand Up @@ -126,9 +129,12 @@ jobs:
run: |
sleep 30
while
[ -z "$(kubectl get ${{ matrix.emqx[0] }} emqx -o json | jq '.status.conditions[] | select((.type == "Running") and (.status == "True"))')" ];
condition="$(kubectl get ${{ matrix.emqx[0] }} emqx -o json | jq '.status.conditions[0]')";
[[ "$condition" == "null" ]] \
|| [[ "$(echo $condition | jq --raw-output '.type')" != "Running" ]] \
|| [[ "$(echo $condition | jq --raw-output '.status')" != "True" ]]
do
echo "waiting ${{ matrix.emqx[0] }}"
echo "waiting"
sleep 1
done
- if: failure()
Expand Down

0 comments on commit a331ed5

Please sign in to comment.