File tree Expand file tree Collapse file tree 4 files changed +25
-15
lines changed
actions/delete-control-plane-app Expand file tree Collapse file tree 4 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 1+ name : Delete Control Plane App
2+ description : ' Deletes a Control Plane application and all its resources'
3+
4+ inputs :
5+ app_name :
6+ description : ' Name of the application to delete'
7+ required : true
8+ cpln_org :
9+ description : ' Organization name'
10+ required : true
11+
12+ runs :
13+ using : " composite"
14+ steps :
15+ - name : Delete Application
16+ shell : bash
17+ run : ${{ github.action_path }}/delete-app.sh
18+ env :
19+ APP_NAME : ${{ inputs.app_name }}
20+ CPLN_ORG : ${{ inputs.cpln_org }}
Original file line number Diff line number Diff line change 2121
2222# Check if app exists before attempting to delete
2323echo " 🔍 Checking if application exists: $APP_NAME "
24- if ! cpflow exists -a " $APP_NAME " ; then
24+ if ! cpflow exists -a " $APP_NAME " --org " $CPLN_ORG " ; then
2525 echo " ⚠️ Application does not exist: $APP_NAME "
2626 exit 0
2727fi
2828
2929# Delete the application
3030echo " 🗑️ Deleting application: $APP_NAME "
31- if ! cpflow delete -a " $APP_NAME " --force; then
31+ if ! cpflow delete -a " $APP_NAME " --org " $CPLN_ORG " -- force; then
3232 echo " ❌ Failed to delete application: $APP_NAME " >&2
3333 exit 1
3434fi
Original file line number Diff line number Diff line change @@ -145,12 +145,7 @@ jobs:
145145 uses : ./.github/actions/delete-control-plane-app
146146 with :
147147 app_name : ${{ env.APP_NAME }}
148- org : ${{ env.CPLN_ORG }}
149- github_token : ${{ secrets.GITHUB_TOKEN }}
150- env :
151- APP_NAME : ${{ env.APP_NAME }}
152- CPLN_ORG : ${{ secrets.CPLN_ORG }}
153- CPLN_TOKEN : ${{ secrets.CPLN_TOKEN }}
148+ org : ${{ vars.CPLN_ORG_STAGING }}
154149
155150 - name : Update Delete Status
156151 if : always()
Original file line number Diff line number Diff line change 4848 run : |
4949 for pr in $(echo "${{ steps.stale_prs.outputs.result }}" | jq -r '.[]'); do
5050 APP_NAME="qa-react-webpack-rails-tutorial-pr-$pr"
51+ CPLN_ORG=${{ vars.CPLN_ORG_STAGING }}
5152 echo "🗑️ Deleting stale review app for PR #$pr: $APP_NAME"
52- ${{ github.workspace }}/.github/actions/deploy-to- control-plane/scripts/delete-app.sh
53+ ${{ github.workspace }}/.github/actions/delete- control-plane-app /scripts/delete-app.sh
5354 done
54- env :
55- APP_NAME : qa-react-webpack-rails-tutorial-pr-${{ steps.stale_prs.outputs.result }}
56-
57- - name : Run cleanup-images script
58- run : |
59- cpflow cleanup-images -a qa-react-webpack-rails-tutorial -y
You can’t perform that action at this time.
0 commit comments