File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,13 @@ jobs:
121121 - name : Deploy Application to staging
122122 run : |
123123 export JUJU_MODEL=admin/stg-cs-canonical-com
124- juju refresh cs-canonical-com --path ./cs-canonical-com_ubuntu-22.04-amd64.charm --resource flask-app-image=${{ needs.publish-image.outputs.image_url }}
124+ if juju status --relations | grep -q "cs-canonical-com"; then
125+ echo "Application 'cs-canonical-com' exists. Running juju refresh..."
126+ juju refresh cs-canonical-com --path ./*.charm --resource flask-app-image=${{ needs.publish-image.outputs.image_url }}
127+ else
128+ echo "Application 'cs-canonical-com' not found. Running juju deploy..."
129+ juju deploy ./*.charm cs-canonical-com --resource flask-app-image=${{ needs.publish-image.outputs.image_url }}
130+ fi
125131 juju wait-for application cs-canonical-com --query='name=="cs-canonical-com" && (status=="active" || status=="idle")'
126132
127133 deploy-production :
@@ -159,5 +165,11 @@ jobs:
159165 - name : Deploy Application to production
160166 run : |
161167 export JUJU_MODEL=admin/prod-cs-canonical-com
162- juju refresh cs-canonical-com --path ./cs-canonical-com_ubuntu-22.04-amd64.charm --resource flask-app-image=${{ needs.publish-image.outputs.image_url }}
168+ if juju status --relations | grep -q "cs-canonical-com"; then
169+ echo "Application 'cs-canonical-com' exists. Running juju refresh..."
170+ juju refresh cs-canonical-com --path ./*.charm --resource flask-app-image=${{ needs.publish-image.outputs.image_url }}
171+ else
172+ echo "Application 'cs-canonical-com' not found. Running juju deploy..."
173+ juju deploy ./*.charm cs-canonical-com --resource flask-app-image=${{ needs.publish-image.outputs.image_url }}
174+ fi
163175 juju wait-for application cs-canonical-com --query='name=="cs-canonical-com" && (status=="active" || status=="idle")'
You can’t perform that action at this time.
0 commit comments