Skip to content

Commit 59ecd70

Browse files
authored
CLOUDP-192880: Make clean CLI tool (#1149)
Signed-off-by: Jose Vazquez <[email protected]>
1 parent 3e3a475 commit 59ecd70

File tree

29 files changed

+127
-665
lines changed

29 files changed

+127
-665
lines changed

.github/actions/clean-vpc/go.mod

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/actions/clean-vpc/go.sum

Lines changed: 0 additions & 234 deletions
This file was deleted.

.github/actions/cleanup-pe/go.mod

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/actions/cleanup-pe/go.sum

Lines changed: 0 additions & 248 deletions
This file was deleted.

.github/actions/cleanup/go.mod

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/actions/cleanup/go.sum

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/cleanup-all.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
with:
4141
go-version-file: "${{ github.workspace }}/go.mod"
4242

43+
- name: Build & Test clean tool
44+
run: (cd tools/clean && go build . && go test .)
45+
4346
- name: Run cleanup VPC
4447
if: github.event_name == 'schedule' || github.event.inputs.cleanVPC == 'true'
4548
env:
@@ -48,7 +51,7 @@ jobs:
4851
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
4952
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5053
GCP_SA_CRED: ${{ secrets.GCP_SA_CRED }}
51-
run: (cd .github/actions/clean-vpc && go run .)
54+
run: (cd tools/clean && ./clean vpc)
5255

5356
- name: Run cleanup PE
5457
if: github.event_name == 'schedule' || github.event.inputs.cleanPE == 'true'
@@ -61,7 +64,7 @@ jobs:
6164
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
6265
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
6366
GCP_SA_CRED: ${{ secrets.GCP_SA_CRED }}
64-
run: (cd .github/actions/cleanup-pe && go run .)
67+
run: (cd tools/clean && ./clean pe)
6568

6669
- name: Run atlas project cleaner
6770
if: always()
@@ -70,4 +73,4 @@ jobs:
7073
MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
7174
CLEAN_ALL: ${{ github.event.inputs.clean }}
7275
MAX_PROJECT_LIFETIME: ${{ github.event.inputs.timelife }}
73-
run: (cd .github/actions/cleanup && go run .)
76+
run: (cd tools/clean && ./clean atlas)

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ tmp/
4242

4343
# ready to work samples
4444
deploy/
45+
46+
# ignore tool binaries
47+
tools/clean/clean

go.work

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
go 1.21.1
2+
3+
use (
4+
.
5+
./tools/clean
6+
)

go.work.sum

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
2+
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
3+
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
4+
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
5+
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
6+
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
7+
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
8+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
9+
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=

0 commit comments

Comments
 (0)