-
Notifications
You must be signed in to change notification settings - Fork 78
68 lines (60 loc) · 2.03 KB
/
cleanup-test.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Clean Atlas organization
on:
schedule:
- cron: "*/30 7-22 * * 1-5"
workflow_dispatch:
inputs:
lifetime:
description: "Lifetime of project in hours"
type: number
default: 1
required: true
workflow_call:
inputs:
lifetime:
description: "Lifetime of project in hours"
type: number
default: 1
required: true
concurrency:
group: cleanup-test
jobs:
cleanup:
environment: test
name: Cleanup Atlas Cloud
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: 'true'
- name: Build clean tool
run: |
devbox run -- 'cd tools/clean && go build .'
- name: Persist GCP credentials
id: gcp-cred
env:
GCP_SA_CRED: ${{ secrets.GCP_SA_CRED }}
run: |
echo $GCP_SA_CRED > ~/gcp_sa_cred.json
echo credentials=$(realpath ~/gcp_sa_cred.json) >> $GITHUB_OUTPUT
- name: Run cleaner
env:
MCLI_OPS_MANAGER_URL: 'https://cloud-qa.mongodb.com/'
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
MCLI_ORG_ID: ${{ secrets.ATLAS_ORG_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.gcp-cred.outputs.credentials }}
GOOGLE_PROJECT_ID: atlasoperator
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_RESOURCE_GROUP_NAME: svet-test
PROJECT_LIFETIME: ${{ inputs.lifetime || 1 }}
run: |
devbox run -- 'cd tools/clean && ./clean atlas'