-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
61 lines (56 loc) · 1.73 KB
/
cloudbuild.yaml
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
timeout: 3600s
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
for pr in $(python3 scripts/listprojects.py config/projects.json)
do
gsutil mb -c regional -l europe-west1 gs://${PROJECT_ID}-${pr}-backup-stg/
gsutil iam ch serviceAccount:${pr}@appspot.gserviceaccount.com:roles/storage.legacyBucketWriter gs://${PROJECT_ID}-${pr}-backup-stg/
done
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
git clone --branch=${_DCAT_DEPLOY_BRANCH_NAME} https://github.com/vwt-digital/dcat-deploy.git
dcat-deploy/deploy_dcat_gcp.sh config/${PROJECT_ID}/data_catalog.json $PROJECT_ID
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
gcloud builds submit --substitutions=_TARGET_PROJECT_ID=${_PROJECT_SOURCE},_TOPIC_NAME=${_TOPIC_NAME} .
dir: 'functions/pub_sub_relay'
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- 'gcloud beta scheduler jobs delete --quiet automated_back_up_job || exit 0'
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'beta'
- 'scheduler'
- 'jobs'
- 'create'
- 'pubsub'
- 'automated_back_up_job'
- '--schedule=0 4 * * 1-5'
- '--topic=${_TOPIC_NAME}'
- '--message-body={ "data": "test"}'
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
cp ../../config.py config.py
cp ../../requirements.txt requirements.txt
for pr in $(python3 ../../scripts/listprojects.py ../../config/projects.json)
do
gcloud builds submit --substitutions=_BUCKET_NAME="${PROJECT_ID}-${pr}-backup-stg",_PROJECT_NAME=${pr} .
done
dir: 'functions/test_git_backup'
substitutions:
_DCAT_DEPLOY_BRANCH_NAME: master