cmd/locktrigger: generalize repo
Require a -repo flag for the repo to clone, instead of hardcoded x/website. Change-Id: I7fffd07b24d070e8e825fc3a5962bd506ea98f07 Reviewed-on: https://go-review.googlesource.com/c/website/+/377794 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Родитель
5be32adfba
Коммит
60e69eecf2
|
@ -15,7 +15,8 @@ steps:
|
|||
- name: golang
|
||||
args: ["bash", "-c", "go run ./cmd/events > ./_content/events.yaml"]
|
||||
- name: golang
|
||||
args: ["go", "run", "./cmd/locktrigger", "--project=$PROJECT_ID", "--build=$BUILD_ID"]
|
||||
args: ["go", "run", "./cmd/locktrigger", "--project=$PROJECT_ID",
|
||||
"--build=$BUILD_ID", "--repo=https://go.googlesource.com/website"]
|
||||
- name: gcr.io/cloud-builders/gcloud
|
||||
entrypoint: bash
|
||||
args: ["./go-app-deploy.sh", "cmd/golangorg/app.yaml"]
|
||||
|
|
|
@ -54,10 +54,11 @@ import (
|
|||
var (
|
||||
project = flag.String("project", "", "GCP project `name` (required)")
|
||||
build = flag.String("build", "", "GCP build `id` (required)")
|
||||
repo = flag.String("repo", "", "`URL` of repository (required)")
|
||||
)
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "usage: locktrigger -project=name -build=id\n")
|
||||
fmt.Fprintf(os.Stderr, "usage: locktrigger -project=name -build=id -repo=URL\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
|
@ -67,7 +68,7 @@ func main() {
|
|||
log.SetPrefix("locktrigger: ")
|
||||
log.SetFlags(0)
|
||||
|
||||
if *project == "" || *build == "" {
|
||||
if *project == "" || *build == "" || *repo == "" {
|
||||
usage()
|
||||
}
|
||||
|
||||
|
@ -140,7 +141,7 @@ func main() {
|
|||
// if we are the only build that is running.
|
||||
if shallow {
|
||||
log.Printf("git fetch --unshallow")
|
||||
run("git", "fetch", "--unshallow", "https://go.googlesource.com/website")
|
||||
run("git", "fetch", "--unshallow", *repo)
|
||||
shallow = false
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче