From 1b091e590bab0f0e98b815d7dd42b1e29041b473 Mon Sep 17 00:00:00 2001 From: Hana Kim Date: Sun, 22 Mar 2026 18:37:51 +0000 Subject: deploy: run go mod tidy in go container CL 757540 tried to run `go mod tidy` during the prepare.sh run, but it turned out the script runs in a stage where `go` is unavailable. Instead, move the (cd private && go mod tidy) run in a new step that runs in the go container right after the prepare step. Change-Id: I4595fc9b5e9b0172753b0b4d1425093449d84421 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/757920 kokoro-CI: kokoro Reviewed-by: Ethan Lee LUCI-TryBot-Result: Go LUCI Auto-Submit: Hyang-Ah Hana Kim --- deploy/deploy-env.yaml | 6 ++++++ deploy/deploy.yaml | 6 ++++++ deploy/prepare.sh | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/deploy/deploy-env.yaml b/deploy/deploy-env.yaml index 8bc94629..7f606f6a 100644 --- a/deploy/deploy-env.yaml +++ b/deploy/deploy-env.yaml @@ -21,6 +21,12 @@ steps: entrypoint: deploy/prepare.sh args: - $PROJECT_ID + - id: Tidy private + name: golang:1.25.5 + entrypoint: sh + args: + - -c + - cd private && go mod tidy - id: Check redistributable name: golang:1.25.5 entrypoint: private/devtools/check_redist.sh diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index b2bbe955..96169118 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -21,6 +21,12 @@ steps: entrypoint: deploy/prepare.sh args: - $PROJECT_ID + - id: Tidy private + name: golang:1.25.5 + entrypoint: sh + args: + - -c + - cd private && go mod tidy - id: Check redistributable name: golang:1.25.5 entrypoint: private/devtools/check_redist.sh diff --git a/deploy/prepare.sh b/deploy/prepare.sh index cf153862..833b0b3e 100755 --- a/deploy/prepare.sh +++ b/deploy/prepare.sh @@ -21,7 +21,6 @@ main() { local project_id=$1 gcloud source repos clone private private source private/devtools/lib.sh || { echo "Are you at repo root?"; exit 1; } - (cd private && go mod tidy) (cd private && docker_image_tag > ../_BUILD_TAG) private/devtools/idtoken.sh $project_id > _ID_TOKEN } -- cgit v1.3