From 01eb4009551ab18b517820f67d45c6384f9391cc Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 30 Dec 2015 10:50:42 -0800 Subject: [PATCH] misc/docker/dock.go: make final download tarballs public Change-Id: I842b76ce68fe99530bd0a85f0dbdcdd6925e1b5a --- misc/docker/dock.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/misc/docker/dock.go b/misc/docker/dock.go index b4c34df3a..067f01ca7 100644 --- a/misc/docker/dock.go +++ b/misc/docker/dock.go @@ -216,11 +216,11 @@ func uploadReleaseTarball() { w := stoClient.Bucket(bucket).Object(versionedTarball).NewWriter(ctx) w.ACL = publicACL(proj) w.CacheControl = "no-cache" // TODO: remove for non-tip releases? set expirations? + contentType := "application/x-gtar" if *buildOS == "windows" { - w.ContentType = "application/zip" - } else { - w.ContentType = "application/x-gtar" + contentType = "application/zip" } + w.ContentType = contentType src, err := os.Open(releaseTarball) if err != nil { @@ -237,7 +237,13 @@ func uploadReleaseTarball() { log.Printf("Uploaded tarball to %s", versionedTarball) if !isWIP() { log.Printf("Copying tarball to %s/%s ...", bucket, tarball) - if _, err := stoClient.CopyObject(ctx, bucket, versionedTarball, bucket, tarball, nil); err != nil { + if _, err := stoClient.CopyObject(ctx, + bucket, versionedTarball, + bucket, tarball, + &storage.ObjectAttrs{ + ACL: publicACL(proj), + ContentType: contentType, + }); err != nil { log.Fatalf("Error uploading %v: %v", tarball, err) } log.Printf("Uploaded tarball to %s", tarball)