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:
Родитель
c386b489b9
Коммит
081156a208
|
@ -27,10 +27,9 @@ on production resources.
|
||||||
## Deploying to go.dev and golang.org
|
## Deploying to go.dev and golang.org
|
||||||
|
|
||||||
Each time a CL is reviewed and submitted, the site is automatically deployed to App Engine.
|
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,
|
If it passes its serving-readiness checks, it will be automatically promoted to handle traffic.
|
||||||
the new deployment automatically becomes https://go.dev/.
|
Whether it passes or not, the new deployment can be found in the
|
||||||
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).
|
||||||
[App Engine versions list](https://console.cloud.google.com/appengine/versions?project=golang-org&serviceId=default) and verified and manually promoted.
|
|
||||||
|
|
||||||
If the automatic deployment is not working, or to check on the status of a pending deployment,
|
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
|
see the “website-redeploy-golang-org” trigger in the
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
#
|
#
|
||||||
# It customizes the usual "gcloud app deploy" in two ways.
|
# It customizes the usual "gcloud app deploy" in two ways.
|
||||||
#
|
#
|
||||||
# First, it sets --no-promote or --promote according to whether
|
# First, it deploys with --no-promote and only promotes after
|
||||||
# the commit had a Website-Publish vote.
|
# the deployed app has passed an in-prod readiness test.
|
||||||
#
|
#
|
||||||
# Second, it chooses an app version like 2021-06-02-204309-2c120970
|
# Second, it chooses an app version like 2021-06-02-204309-2c120970
|
||||||
# giving the date, time, and commit hash of the commit being deployed.
|
# 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
|
# Cloud Build at once and would otherwise end up with timestamps in
|
||||||
# arbitrary order depending on the order in which Cloud Build happened
|
# arbitrary order depending on the order in which Cloud Build happened
|
||||||
# to reach each's gcloud app deploy command. With our choice, the
|
# 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
|
set -e
|
||||||
|
|
||||||
|
@ -44,16 +44,6 @@ if [ $# != 0 ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
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')
|
version=$(git log -n1 --date='format:%Y-%m-%d-%H%M%S' --pretty='format:%cd-%h')
|
||||||
|
|
||||||
service=$(awk '$1=="service:" {print $2}' $yaml)
|
service=$(awk '$1=="service:" {print $2}' $yaml)
|
||||||
|
@ -72,15 +62,20 @@ curl --version
|
||||||
for i in 1 2 3 4 5; do
|
for i in 1 2 3 4 5; do
|
||||||
if curl -s --fail --show-error "https://$host/_readycheck"; then
|
if curl -s --fail --show-error "https://$host/_readycheck"; then
|
||||||
echo '### site is up!'
|
echo '### site is up!'
|
||||||
if $promote; then
|
|
||||||
serving=$(gcloud app services describe --project=$project $service | grep ': 1.0')
|
# We used to have to worry about go-app-deploy.sh running for
|
||||||
if [ "$serving" '>' "$version" ]; then
|
# other commits simultaneously, so we checked that we weren't
|
||||||
echo "### serving version $serving is newer than our $version; not promoting"
|
# going to stomp a newer version of the web site.
|
||||||
exit 1
|
# The use of locktrigger in cloudbuild.yaml should make this impossible,
|
||||||
fi
|
# but keep checking anyway.
|
||||||
echo '### promoting'
|
serving=$(gcloud app services describe --project=$project $service | grep ': 1.0')
|
||||||
gcloud -q --project=$project app services set-traffic $service --splits=$version=1
|
if [ "$serving" '>' "$version" ]; then
|
||||||
|
echo "### serving version $serving is newer than our $version; not promoting"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo '### promoting'
|
||||||
|
gcloud -q --project=$project app services set-traffic $service --splits=$version=1
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo '### not healthy'
|
echo '### not healthy'
|
||||||
|
@ -89,4 +84,3 @@ done
|
||||||
|
|
||||||
echo "### failed to become healthy; giving up"
|
echo "### failed to become healthy; giving up"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче