Skip to content

Commit 3e3d25a

Browse files
committed
Update Cloud Build configuration to use timestamp for App Engine versioning
1 parent 33a3387 commit 3e3d25a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cloudbuild.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Update the trigger at:
77
# https://console.cloud.google.com/cloud-build/triggers;region=us-central1/edit/2bd8fcc6-6319-455d-88f2-38d564fe2db8?project=httparchive
88
#
9-
# $SHORT_SHA is set automatically by Cloud Build on a branch-push trigger.
9+
# The deploy version is a UTC timestamp generated at deploy time (e.g. 20211111t105151).
1010

1111
substitutions:
1212
# Update when a new Prince version is released: https://www.princexml.com/latest/
@@ -98,8 +98,7 @@ steps:
9898
# ─────────────────────────────────────────────────────────────────────────
9999
# Step 3: Deploy to Google App Engine.
100100
# app.yaml is read from /workspace/src (dir: src).
101-
# App Engine version labels must start with a letter, so SHORT_SHA is
102-
# prefixed: e.g. a1b2c3d → deploy-a1b2c3d.
101+
# App Engine version is a timestamp, e.g. 20211111t105151.
103102
# ─────────────────────────────────────────────────────────────────────────
104103
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
105104
id: 'deploy'
@@ -109,8 +108,7 @@ steps:
109108
- '-c'
110109
- |
111110
set -e
112-
VERSION="deploy-${SHORT_SHA}"
113-
echo "Deploying version: ${VERSION}"
111+
VERSION=$(date -u +'%Y%m%dt%H%M%S')
114112
gcloud app deploy \
115113
--project webalmanac \
116114
--version="${VERSION}" \

0 commit comments

Comments
 (0)