From 47a36577cf18e83a9d242f791fe4c98fd0522f70 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 9 Jun 2022 13:31:09 -0700 Subject: feat(gerrit): update CL when buildKite build is finished buildKite can call specific hooks at various stages ([1]). We add a hook to run after each command. For now we only care if the label of the command is `:hammer:', since this is what we've defined for our pipeline. After a successful build, the agent will post a review with +1 if it's a success, or -1 if the build results in failure. [1] https://buildkite.com/docs/agent/v3/hooks#job-lifecycle-hooks Change-Id: I6b2b886c13e6f23ddbc96fd3e865f0d50d625446 Reviewed-on: https://cl.fcuny.net/c/world/+/305 Reviewed-by: Franck Cuny --- tools/gerrit-hook/main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/gerrit-hook/main.go') diff --git a/tools/gerrit-hook/main.go b/tools/gerrit-hook/main.go index f8ed687..aae73ba 100644 --- a/tools/gerrit-hook/main.go +++ b/tools/gerrit-hook/main.go @@ -57,6 +57,8 @@ func main() { os.Exit(1) } gerritHookMain(cfg, log, trigger) + } else if cmd == "post-command" { + postCommand(cfg) } else { log.Info(fmt.Sprintf("`%s' is not a supported command", cmd)) os.Exit(1) -- cgit 1.4.1