-
Notifications
You must be signed in to change notification settings - Fork 178
53 lines (51 loc) · 2.14 KB
/
cleanup-test-env.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: 'Cleanup test env'
on:
workflow_dispatch: {} # workflow can be run manually
schedule:
- cron: "0 3 * * *" # workflow runs every day at 03:00 AM
jobs:
clenup-test-env-general:
runs-on: ubuntu-latest
steps:
- name: setup Atlas CLI
uses: andreaangiolillo/[email protected]
with:
public-key: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }}
private-key: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV }}
org-id: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV }}
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
- name: Cleanup cloud-dev
shell: bash
env:
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }}
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV }}
MONGODB_ATLAS_ORG_ID: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV }}
MONGODB_ATLAS_OPS_MANAGER_URL: ${{vars.MONGODB_ATLAS_BASE_URL}}
run: ./scripts/cleanup-test-env.sh
clenup-test-env-network:
runs-on: ubuntu-latest
steps:
- name: Setup Atlas CLI
uses: andreaangiolillo/[email protected]
with:
public-key: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV_NETWORK }}
private-key: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV_NETWORK }}
org-id: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV_NETWORK }}
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
- name: Cleanup test env network
shell: bash
env:
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV_NETWORK }}
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV_NETWORK }}
MONGODB_ATLAS_ORG_ID: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV_NETWORK }}
MONGODB_ATLAS_OPS_MANAGER_URL: ${{vars.MONGODB_ATLAS_BASE_URL}}
PROJECT_TO_NOT_DELETE: ${{vars.MONGODB_ATLAS_PROJECT_ID_CLOUD_DEV_NETWORK}}
run: ./scripts/cleanup-test-env.sh