Skip to content

Commit 349e30a

Browse files
authored
Merge pull request #3658 from PolicyEngine/fix/remove-cloud-run-api-bootstrap
Remove Cloud Run deploy bootstrap commands
2 parents 1a22660 + 84d1a0f commit 349e30a

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

.github/scripts/build_cloud_run_image.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,21 @@ source .github/scripts/cloud_run_env.sh
66
cloud_run_set_defaults
77

88
if [[ "${CLOUD_RUN_DRY_RUN:-0}" == "1" ]]; then
9-
cloud_run_run gcloud services enable run.googleapis.com artifactregistry.googleapis.com cloudbuild.googleapis.com --project "${CLOUD_RUN_PROJECT}"
109
cloud_run_run gcloud artifacts repositories describe "${CLOUD_RUN_ARTIFACT_REPOSITORY}" --project "${CLOUD_RUN_PROJECT}" --location "${CLOUD_RUN_REGION}"
11-
cloud_run_run gcloud artifacts repositories create "${CLOUD_RUN_ARTIFACT_REPOSITORY}" --repository-format docker --location "${CLOUD_RUN_REGION}" --description "Docker repository for PolicyEngine API Cloud Run"
1210
cloud_run_run gcloud auth configure-docker "${CLOUD_RUN_REGION}-docker.pkg.dev" --quiet
1311
cloud_run_run docker build -f gcp/cloud_run/Dockerfile -t "${CLOUD_RUN_IMAGE_URI}" .
1412
cloud_run_run docker push "${CLOUD_RUN_IMAGE_URI}"
1513
exit 0
1614
fi
1715

18-
gcloud services enable run.googleapis.com artifactregistry.googleapis.com cloudbuild.googleapis.com --project "${CLOUD_RUN_PROJECT}"
19-
2016
if ! gcloud artifacts repositories describe "${CLOUD_RUN_ARTIFACT_REPOSITORY}" \
2117
--project "${CLOUD_RUN_PROJECT}" \
2218
--location "${CLOUD_RUN_REGION}" >/dev/null 2>&1; then
23-
gcloud artifacts repositories create "${CLOUD_RUN_ARTIFACT_REPOSITORY}" \
24-
--repository-format docker \
25-
--location "${CLOUD_RUN_REGION}" \
26-
--description "Docker repository for PolicyEngine API Cloud Run"
19+
cat >&2 <<EOF
20+
Missing Artifact Registry repository '${CLOUD_RUN_ARTIFACT_REPOSITORY}' in ${CLOUD_RUN_PROJECT}/${CLOUD_RUN_REGION}.
21+
Provision the repository once before running Cloud Run deploys.
22+
EOF
23+
exit 1
2724
fi
2825

2926
gcloud auth configure-docker "${CLOUD_RUN_REGION}-docker.pkg.dev" --quiet
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removed one-time Cloud Run API enablement and Artifact Registry repository creation from the deploy image build script.

0 commit comments

Comments
 (0)