Skip to content

Commit f9cd167

Browse files
authored
Copy artifacts for schema tests after deployment (#2895)
After each deployment in sandbox or production, move the artifacts from the corresponding release to a well-known location so that they can be mapped to Kokoro in presubmit tests. The Kokoro-mapping does not need public access to the GCS bucket. The artifacts include the postgresql schema jar, the nomulus release jar, and the uber jar of the nomulus schema integration test classes. Every jar name consists of a fixed prefix and the environment. Each jar of a new deployment overrides the previous copy.
1 parent eed1886 commit f9cd167

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

release/cloudbuild-deploy-gke.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ steps:
4343
deployCloudSchedulerAndQueue nomulus-config-${_ENV}.yaml cloud-scheduler-tasks-${_ENV}.xml $project_id --gke
4444
deployCloudSchedulerAndQueue nomulus-config-${_ENV}.yaml cloud-tasks-queue.xml $project_id --gke
4545
# Save the deployed tag for the current environment on GCS, and update the
46-
# mappings from Nomulus releases to deployment timestamp.
46+
# mappings from Nomulus releases to deployment timestamp. Also copy the
47+
# artifacts for schema tests to here. They will be mapped into Kokoro for
48+
# presubmit tests.
4749
- name: 'gcr.io/$PROJECT_ID/builder:latest'
4850
entrypoint: /bin/bash
4951
args:
@@ -60,6 +62,11 @@ steps:
6062
gs://$PROJECT_ID-deployed-tags/nomulus-gke.${_ENV}.versions \
6163
gs://$PROJECT_ID-deployed-tags/nomulus-gke.${_ENV}.tmp \
6264
gs://$PROJECT_ID-deployed-tags/nomulus-gke.${_ENV}.versions
65+
# Copy the nomulus artifacts for schema test: nomulus foss jars and the uberjar of nomulus test classes.
66+
gcloud storage cp gs://$PROJECT_ID-deploy/${TAG_NAME}/nomulus-public.jar \
67+
gs://$PROJECT_ID-deployed-tags/schema-test-artifacts/nomulus-public.${_ENV}.jar
68+
gcloud storage cp gs://$PROJECT_ID-deploy/${TAG_NAME}/nomulus-tests-alldeps.jar \
69+
gs://$PROJECT_ID-deployed-tags/schema-test-artifacts/nomulus-tests-alldeps.${_ENV}.jar
6370
timeout: 3600s
6471
options:
6572
machineType: 'E2_HIGHCPU_32'

release/cloudbuild-schema-deploy.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ steps:
7575
# Save the deployed tag for the current environment on GCS to a well-known.
7676
# location. Do not use the 'artifacts' section for this since it will
7777
# upload an extra metadata file every time and pollute the folder.
78-
# TODO(weiminyu): modify this step so that TAG_NAME may be 'live'.
78+
# Also copy the schema jar here. It will be mapped into Kokoro for presubmit tests.
7979
- name: 'gcr.io/$PROJECT_ID/builder:latest'
8080
entrypoint: /bin/bash
8181
args:
@@ -84,6 +84,9 @@ steps:
8484
set -e
8585
echo ${TAG_NAME} | \
8686
gcloud storage cp - gs://$PROJECT_ID-deployed-tags/sql.${_ENV}.tag\
87+
# Copy the schema jar here
88+
gcloud storage cp gs://$PROJECT_ID-deploy/${TAG_NAME}/schema.jar \
89+
gs://$PROJECT_ID-deployed-tags/schema-test-artifacts/schema.${_ENV}.jar
8790
timeout: 3600s
8891
options:
8992
machineType: 'E2_HIGHCPU_32'

0 commit comments

Comments
 (0)