From 9a6f6af6455424cf17d1dc3db8b6c1b2a0c1f058 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 20 Sep 2018 18:26:15 +0200 Subject: syz-ci: upload coverage reports to GCS Upload coverage reports from all managers to GCS after 6 hours of runtime (to make it more apples-to-apples). --- pkg/gcs/gcs.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkg/gcs') diff --git a/pkg/gcs/gcs.go b/pkg/gcs/gcs.go index 7e832de41..7da24d6e2 100644 --- a/pkg/gcs/gcs.go +++ b/pkg/gcs/gcs.go @@ -107,6 +107,19 @@ func (client *Client) FileWriter(gcsFile string) (io.WriteCloser, error) { return w, nil } +// Publish lets any user read gcsFile. +func (client *Client) Publish(gcsFile string) error { + bucket, filename, err := split(gcsFile) + if err != nil { + return err + } + obj := client.client.Bucket(bucket).Object(filename) + return obj.ACL().Set(client.ctx, storage.AllUsers, storage.RoleReader) +} + +// Where things get published. +const PublicPrefix = "https://storage.googleapis.com/" + func split(file string) (bucket, filename string, err error) { pos := strings.IndexByte(file, '/') if pos == -1 { -- cgit mrf-deployment