misc/docker/dock.go: make final download tarballs public

Change-Id: I842b76ce68fe99530bd0a85f0dbdcdd6925e1b5a
This commit is contained in:
Brad Fitzpatrick 2015-12-30 10:50:42 -08:00
parent 7b78c50007
commit 01eb400955
1 changed files with 10 additions and 4 deletions

View File

@ -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)