@@ -30,7 +30,7 @@ substitutions:
3030 _AR_REPO_URL : ' us-docker.pkg.dev/datcom-ci/gcr.io'
3131 _BQ_SPANNER_CONN_ID : ' projects/datcom-ci/locations/us-central1/connections/bq_spanner_conn_test'
3232 _VERSION : ' ${SHORT_SHA}'
33- _DATAFLOW_TEMPLATE_PATH : ' gs://datcom-templates/templates/flex/ingestion.json'
33+ _DATAFLOW_TEMPLATE_PATH : ' gs://datcom-templates/templates/flex/ingestion-${_VERSION} .json'
3434 _PROD_TAG : ' latest' # TODO: rename to prod
3535
3636steps :
@@ -39,12 +39,21 @@ steps:
3939- id : ' build-ingestion-helper'
4040 name : ' gcr.io/cloud-builders/gcloud'
4141 args : ['builds', 'submit', 'ingestion-helper', '--config', 'ingestion-helper/cloudbuild.yaml', '--substitutions', '_AR_REPO_URL=${_AR_REPO_URL},_VERSION=${_VERSION}']
42- dir : ' import-automation /workflow'
42+ dir : ' pipeline /workflow'
4343
4444- id : ' build-import-helper'
4545 name : ' gcr.io/cloud-builders/gcloud'
4646 args : ['builds', 'submit', 'import-helper', '--config', 'import-helper/cloudbuild.yaml', '--substitutions', '_AR_REPO_URL=${_AR_REPO_URL},_VERSION=${_VERSION}']
47- dir : ' import-automation/workflow'
47+ dir : ' pipeline/workflow'
48+
49+ - id : ' build-dataflow-template'
50+ name : ' gcr.io/cloud-builders/gcloud'
51+ args :
52+ - ' builds'
53+ - ' submit'
54+ - ' .'
55+ - ' --config=pipeline/ingestion/cloudbuild.yaml'
56+ - ' --substitutions=_VERSION=${_VERSION},_IMAGE_GCR_PATH=${_AR_REPO_URL}/dataflow-templates/ingestion,_INSTANCE_ID=${_SPANNER_INSTANCE_ID},_DATABASE_ID=${_SPANNER_DATABASE_ID},_GCS_BUCKET=${_GCS_BUCKET_ID},_REGION=${_LOCATION}'
4857
4958# 2. Trigger Staging Build (Child)
5059# Overrides default (Production) values with Staging values.
5766 - ' --config=cloudbuild.yaml'
5867 - ' --project=${_PROJECT_ID}'
5968 - ' --substitutions=_PROJECT_ID=${_PROJECT_ID},_SPANNER_PROJECT_ID=${_SPANNER_PROJECT_ID},_SPANNER_INSTANCE_ID=${_SPANNER_INSTANCE_ID},_SPANNER_DATABASE_ID=${_SPANNER_DATABASE_ID},_SPANNER_GRAPH_DATABASE_ID=${_SPANNER_GRAPH_DATABASE_ID},_GCS_BUCKET_ID=${_GCS_BUCKET_ID},_LOCATION=${_LOCATION},_GCS_MOUNT_BUCKET=${_GCS_MOUNT_BUCKET},_BQ_DATASET_ID=${_BQ_DATASET_ID},_PROJECT_NUMBER=${_PROJECT_NUMBER},_BQ_SPANNER_CONN_ID=${_BQ_SPANNER_CONN_ID},_VERSION=${_VERSION},_DATAFLOW_TEMPLATE_PATH=${_DATAFLOW_TEMPLATE_PATH}'
60- dir : ' import-automation /workflow'
69+ dir : ' pipeline /workflow'
6170
6271# 2. Run E2E Tests on Staging
6372- id : ' e2e-test-staging'
@@ -75,12 +84,12 @@ steps:
7584 - ' SPANNER_INSTANCE_ID=${_SPANNER_INSTANCE_ID}'
7685 - ' SPANNER_DATABASE_ID=${_SPANNER_DATABASE_ID}'
7786 - ' GCS_BUCKET_ID=${_GCS_BUCKET_ID}'
78- dir : ' import-automation /workflow'
87+ dir : ' pipeline /workflow'
7988
8089- id : ' tag-prod'
8190 name : ' gcr.io/cloud-builders/gcloud'
8291 args : ['builds', 'submit', '.', '--config', 'tag-prod.yaml', '--substitutions', '_AR_REPO_URL=${_AR_REPO_URL},_PROD_TAG=${_PROD_TAG},_VERSION=${_VERSION}']
83- dir : ' import-automation /workflow'
92+ dir : ' pipeline /workflow'
8493
8594# 3. Trigger Production Build (Child)
8695# Uses default (Production) values defined in cloudbuild.yaml.
@@ -93,7 +102,7 @@ steps:
93102 - ' --config=cloudbuild.yaml'
94103 - ' --project=${_PROJECT_ID}' # Build runs in CI project, deploys to Prod
95104 - ' --substitutions=_VERSION=${_PROD_TAG}'
96- dir : ' import-automation /workflow'
105+ dir : ' pipeline /workflow'
97106
98107options :
99108 logging : CLOUD_LOGGING_ONLY
0 commit comments