blob: 6cd2f60fffc307d85b6154e9482100f22426d6ce [file] [log] [blame]
# This Cloud Build file is run automatically when commits land in the website repo.
# See;region=global?project=golang-org.
# Do not run directly.
# Clone go repo to for use by uploaded app.
- name:
args: ["clone", "--branch=release-branch.go1.22", "--depth=1", "", "_gotmp"]
- name:
args: ["archive", "--format=zip", "--output=../", "HEAD"]
dir: _gotmp
- name: golang
args: ["rm", "-rf", "_gotmp"]
# Clone wiki repo into _content/wiki as initial wiki content.
# The server will replace this with the wiki repo when it can,
# but this provides a good fallback.
- name:
args: ["clone", "--depth=1", "", "_wikitmp"]
- name: golang
args: ["rm", "-rf", "_wikitmp/.git"]
- name: golang
args: ["sh", "-c", "cp -a _wikitmp/* _content/wiki"]
# Run tests.
- name: golang
args: ["go", "test", "./..."]
# Coordinate with other Cloud Build jobs to deploy only newest commit.
# May abort job here.
- name: golang
args: ["go", "run", "./cmd/locktrigger", "--project=$PROJECT_ID",
"--build=$BUILD_ID", "--repo="]
# Deploy site and redirect traffic (maybe; tests again in prod first).
- name:
entrypoint: bash
args: ["./", "cmd/golangorg/app.yaml"]
# Clean up stale versions.
- name: golang
args: ["go", "run", "./cmd/versionprune", "--dry_run=false", "--project=$PROJECT_ID", "--service=default"]
machineType: N1_HIGHCPU_8