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 21
21
22
22
# Check if app exists before attempting to delete
23
23
echo " 🔍 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
25
25
echo " ⚠️ Application does not exist: $APP_NAME "
26
26
exit 0
27
27
fi
28
28
29
29
# Delete the application
30
30
echo " 🗑️ 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
32
32
echo " ❌ Failed to delete application: $APP_NAME " >&2
33
33
exit 1
34
34
fi
Original file line number Diff line number Diff line change @@ -145,12 +145,7 @@ jobs:
145
145
uses : ./.github/actions/delete-control-plane-app
146
146
with :
147
147
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 }}
154
149
155
150
- name : Update Delete Status
156
151
if : always()
Original file line number Diff line number Diff line change 48
48
run : |
49
49
for pr in $(echo "${{ steps.stale_prs.outputs.result }}" | jq -r '.[]'); do
50
50
APP_NAME="qa-react-webpack-rails-tutorial-pr-$pr"
51
+ CPLN_ORG=${{ vars.CPLN_ORG_STAGING }}
51
52
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
53
54
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