Skip to content

Commit

Permalink
Show model can also be blocked
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRichardson committed Oct 13, 2020
1 parent 2dbe3b6 commit f31b2a8
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,27 @@ jobs:
shell: bash
run: |
set -euxo pipefail
CURRENT=$(juju show-model default --format=json | jq -r '.default | .["agent-version"]')
CURRENT="()"
attempt=0
while true; do
CURRENT=$(juju show-model default --format=json | jq -r '.default | .["agent-version"]' || echo "()")
if [ "$CURRENT" != "()" ]; then
break
fi
sleep 10
attempt=$((attempt+1))
if [ "$attempt" -eq 48 ]; then
echo "Show model timed out"
exit 1
fi
done
VERSION=$(juju version | cut -d "-" -f 1,2 | xargs -I% echo "%.1")
while true; do
juju upgrade-model --agent-version="$VERSION" 2>&1 | tee -a output.log || true
RES=$(cat output.log | grep "upgrade in progress" || echo "NOT-UPGRADING")
if [ $RES = "NOT-UPGRADING" ]; then
if [ "$RES" = "NOT-UPGRADING" ]; then
break
fi
done
Expand Down

0 comments on commit f31b2a8

Please sign in to comment.