website: publish all commits, eliminating Website-Publish+1 vote

The main point of Website-Publish+1 was to manually avoid
a race in Cloud Build when multiple commits land. But now
cmd/locktrigger takes care of that race automatically, so there
is little point to Website-Publish+1 now. Stop looking for it.

(If a commit landed without Website-Publish+1, it would still be
published with the next Website-Publish+1 commit, so it was
no real restriction on who can publish content.)

I considered adding a rule like "DO NOT PUBLISH" in a commit
message means not to publish the commit, but once it lands,
again the next publishable commit is going to publish all
previous commits, so even the possibility of landing such commits
puts the repo in a very fragile state.
Better not to support that idea at all.

Fixes golang/go#36707.

Change-Id: Icfe3bcdb0003608ff84bb300c43b61b542236571
Reviewed-on: https://go-review.googlesource.com/c/website/+/368366
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Russ Cox 2021-12-01 22:50:42 -05:00
Родитель c386b489b9
Коммит 081156a208
2 изменённых файлов: 19 добавлений и 26 удалений

Просмотреть файл

@ -27,10 +27,9 @@ on production resources.
## Deploying to go.dev and golang.org
Each time a CL is reviewed and submitted, the site is automatically deployed to App Engine.
If the CL is submitted with a Website-Publish +1 vote,
the new deployment automatically becomes https://go.dev/.
Otherwise, the new deployment can be found in the
[App Engine versions list](https://console.cloud.google.com/appengine/versions?project=golang-org&serviceId=default) and verified and manually promoted.
If it passes its serving-readiness checks, it will be automatically promoted to handle traffic.
Whether it passes or not, the new deployment can be found in the
[App Engine versions list](https://console.cloud.google.com/appengine/versions?project=golang-org&serviceId=default).
If the automatic deployment is not working, or to check on the status of a pending deployment,
see the “website-redeploy-golang-org” trigger in the

Просмотреть файл

@ -12,8 +12,8 @@
#
# It customizes the usual "gcloud app deploy" in two ways.
#
# First, it sets --no-promote or --promote according to whether
# the commit had a Website-Publish vote.
# First, it deploys with --no-promote and only promotes after
# the deployed app has passed an in-prod readiness test.
#
# Second, it chooses an app version like 2021-06-02-204309-2c120970
# giving the date, time, and commit hash of the commit being deployed.
@ -21,7 +21,7 @@
# Cloud Build at once and would otherwise end up with timestamps in
# arbitrary order depending on the order in which Cloud Build happened
# to reach each's gcloud app deploy command. With our choice, the
# versions are ordered in git order.
# versions are ordered in git time order.
set -e
@ -44,16 +44,6 @@ if [ $# != 0 ]; then
exit 2
fi
promote=$(
git cat-file -p 'HEAD' |
awk '
BEGIN { flag = "false" }
/^Reviewed-on:/ { flag = "false" }
/^Website-Publish:/ { flag = "true" }
END {print flag}
'
)
version=$(git log -n1 --date='format:%Y-%m-%d-%H%M%S' --pretty='format:%cd-%h')
service=$(awk '$1=="service:" {print $2}' $yaml)
@ -72,15 +62,20 @@ curl --version
for i in 1 2 3 4 5; do
if curl -s --fail --show-error "https://$host/_readycheck"; then
echo '### site is up!'
if $promote; then
serving=$(gcloud app services describe --project=$project $service | grep ': 1.0')
if [ "$serving" '>' "$version" ]; then
echo "### serving version $serving is newer than our $version; not promoting"
exit 1
fi
echo '### promoting'
gcloud -q --project=$project app services set-traffic $service --splits=$version=1
# We used to have to worry about go-app-deploy.sh running for
# other commits simultaneously, so we checked that we weren't
# going to stomp a newer version of the web site.
# The use of locktrigger in cloudbuild.yaml should make this impossible,
# but keep checking anyway.
serving=$(gcloud app services describe --project=$project $service | grep ': 1.0')
if [ "$serving" '>' "$version" ]; then
echo "### serving version $serving is newer than our $version; not promoting"
exit 1
fi
echo '### promoting'
gcloud -q --project=$project app services set-traffic $service --splits=$version=1
exit 0
fi
echo '### not healthy'
@ -89,4 +84,3 @@ done
echo "### failed to become healthy; giving up"
exit 1