-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
28 lines (28 loc) · 1.9 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
substitutions:
_SERVICE: gametuner-etl
_SLACK_NOTIFICATION_ICON: ":airflow:"
steps:
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: bash
args:
- -c
- |
gsutil -m rsync -r -d dataproc-appsflyer gs://$PROJECT_ID-etl-dataproc/dataproc
gcloud composer environments describe gametuner-composer-etl --location $LOCATION
gcloud composer environments describe gametuner-composer-etl --location $LOCATION | grep -oP 'dagGcsPrefix: gs://\K.*/'
gcloud composer environments describe gametuner-composer-etl --location $LOCATION | grep -oP 'dagGcsPrefix: gs://\K.*/' | head -c -2
export bucket_name=$(gcloud composer environments describe gametuner-composer-etl --location $LOCATION | grep -oP 'dagGcsPrefix: gs://\K.*/' | head -c -2)
echo "composer bucket name: $bucket_name"
echo "dags bucket folder: gs://$bucket_name/dags"
gsutil -m rsync -r -d etl/plugins gs://$bucket_name/plugins
gsutil -m rsync -r -d etl/dags gs://$bucket_name/dags
gsutil cp etl/data/materialized_fields_config.yaml gs://$bucket_name/data/materialized_fields_config.yaml
custom_comm=$(gcloud composer environments update gametuner-composer-etl --location us-east1 --update-env-variables=COMPOSER_ENVIRONMENT_URL=$(gcloud composer environments describe gametuner-composer-etl --location us-east1 | grep -oP 'airflowUri: \K.*') 2>&1); \
echo "$custom_comm"; \
if [[ "$custom_comm" == *"ERROR: (gcloud.composer.environments.update) INVALID_ARGUMENT: No change in configuration. Must specify a change to configuration.software_configuration.env_variables"* ]]; then \
echo "This failure is expected if there is no change of COMPOSER_ENVIRONMENT_URL" \
else echo "done"; \
fi
serviceAccount: 'projects/$PROJECT_ID/serviceAccounts/cloudbuild@$PROJECT_ID.iam.gserviceaccount.com'
options:
logging: CLOUD_LOGGING_ONLY