Skip to content

Commit f648226

Browse files
committed
deploy: add daily schedule for gotip playground
Create a scheduled trigger to deploy the gotip playground every America/New_York morning. I attempted to create and manage the trigger with gcloud alpha builds triggers create scheduled, however I had to create the schedule portion manually in the web interface. There's probably a way to manage it with configuration in the CLI, but I added documentation to the Makefile on how to update it manually in the meantime. Create command: gcloud alpha builds triggers create scheduled --project=golang-org \ --schedule="15 11 * * *" \ --time-zone="America/New_York" \ --build-config=deploy/deploy_gotip.json \ --repo-type="CLOUD_SOURCE_REPOSITORIES" \ --revision="refs/heads/master" \ --repo-uri="https://source.developers.google.com/p/golang-org/r/playground" \ --name "playground-deploy-gotip-playground" \ --description="Deploy gotip playground daily" For golang/go#48517 Change-Id: I9d58e5a81ae4d590e6492c07cc71806864838c81 Reviewed-on: https://go-review.googlesource.com/c/playground/+/366634 Trust: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
1 parent 9187f21 commit f648226

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,23 @@ test_gvisor: docker
2323
# directory)
2424
test: test_go
2525

26+
define GOTIP_MESSAGE
27+
Note: deploy/gotip_schedule.yaml must be manually managed with gcloud.
28+
Example:
29+
gcloud scheduler jobs update http \
30+
projects/golang-org/locations/us-central1/jobs/playground-deploy-gotip-playground-schedule \
31+
--schedule="0 10 * * *" --time-zone="America/New_York"
32+
endef
33+
export GOTIP_MESSAGE
34+
2635
push-cloudbuild-triggers:
2736
gcloud beta builds triggers import --project golang-org --source deploy/go_trigger.yaml
2837
gcloud beta builds triggers import --project golang-org --source deploy/playground_trigger.yaml
38+
gcloud alpha builds triggers import --project golang-org --source deploy/gotip_scheduled_trigger.yaml
39+
@echo "$$GOTIP_MESSAGE"
2940

3041
pull-cloudbuild-triggers:
3142
gcloud beta builds triggers export --project golang-org playground-redeploy-go-release --destination deploy/go_trigger.yaml
3243
gcloud beta builds triggers export --project golang-org playground-redeploy-playground --destination deploy/playground_trigger.yaml
44+
gcloud alpha builds triggers export --project golang-org playground-deploy-gotip-playground --destination deploy/gotip_scheduled_trigger.yaml
45+
gcloud scheduler --project=golang-org jobs describe --format=yaml playground-deploy-gotip-playground-schedule > deploy/gotip_schedule.yaml

deploy/gotip_schedule.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
attemptDeadline: 180s
2+
description: Deploy gotip playground daily
3+
httpTarget:
4+
body: eyJicmFuY2hOYW1lIjoibWFzdGVyIn0=
5+
headers:
6+
Content-Type: application/octet-stream
7+
User-Agent: Google-Cloud-Scheduler
8+
httpMethod: POST
9+
oauthToken:
10+
scope: https://www.googleapis.com/auth/cloud-platform
11+
serviceAccountEmail: cloud-build-trigger-scheduler@golang-org.iam.gserviceaccount.com
12+
uri: https://cloudbuild.googleapis.com/v1/projects/golang-org/triggers/b30b6980-4b88-4c10-91d4-5705c793fa1b:run
13+
lastAttemptTime: '2021-11-23T16:22:00.122806Z'
14+
name: projects/golang-org/locations/us-central1/jobs/playground-deploy-gotip-playground-schedule
15+
schedule: 0 10 * * *
16+
scheduleTime: '2021-11-24T15:00:00Z'
17+
state: ENABLED
18+
timeZone: America/New_York
19+
userUpdateTime: '2021-11-23T16:27:07Z'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
createTime: '2021-11-23T16:11:02.136351538Z'
2+
description: Deploy gotip playground daily
3+
gitFileSource:
4+
path: deploy/deploy_gotip.json
5+
repoType: CLOUD_SOURCE_REPOSITORIES
6+
revision: refs/heads/master
7+
uri: https://source.developers.google.com/p/golang-org/r/playground
8+
id: b30b6980-4b88-4c10-91d4-5705c793fa1b
9+
name: playground-deploy-gotip-playground
10+
sourceToBuild:
11+
ref: refs/heads/master
12+
repoType: CLOUD_SOURCE_REPOSITORIES
13+
uri: https://source.developers.google.com/p/golang-org/r/playground

0 commit comments

Comments
 (0)