Skip to content

Commit 3da1ecb

Browse files
committed
get current log size
1 parent ed9ec02 commit 3da1ecb

File tree

1 file changed

+6
-3
lines changed
  • deployment/modules/gcp/cloudbuild/tesseract

1 file changed

+6
-3
lines changed

deployment/modules/gcp/cloudbuild/tesseract/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ resource "google_cloudbuild_trigger" "build_trigger" {
134134
id = "bearer_token"
135135
name = "gcr.io/cloud-builders/gcloud"
136136
script = <<EOT
137+
gcloud auth print-access-token > /workspace/cb_access
137138
curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/${local.cloudbuild_service_account}/identity?audience=$(cat /workspace/conformance_url)" > /workspace/cb_identity
138-
139139
EOT
140140
wait_for = ["terraform_apply_conformance_staging"]
141141
}
@@ -146,10 +146,13 @@ resource "google_cloudbuild_trigger" "build_trigger" {
146146
id = "ct_preloader"
147147
name = "golang"
148148
script = <<EOT
149+
START_INDEX=$(curl -H "Authorization: Bearer $(cat /workspace/cb_access)" https://storage.googleapis.com/$(cat /workspace/conformance_bucket_name)/checkpoint | head -2 | tail -1)
150+
echo "Will start preloader at index $START_INDEX"
149151
go run github.com/google/certificate-transparency-go/preload/preloader@master \
150-
--target_log_uri="$(cat /workspace/conformance_url)/arche2025h1.ct.transparency.dev" \
151-
--target_bearer_token="$(cat /workspace/cb_identity)" \
152+
--target_log_uri=$(cat /workspace/conformance_url)/arche2025h1.ct.transparency.dev \
153+
--target_bearer_token="$(cat /workspace/cb_identity)" \
152154
--source_log_uri=https://ct.googleapis.com/logs/us1/argon2025h1
155+
--start_index=$START_INDEX
153156
EOT
154157
wait_for = ["bearer_token"]
155158
}

0 commit comments

Comments
 (0)