good morning!!!!

Skip to content
Snippets Groups Projects
Commit 8b1df1a2 authored by Felix Lange's avatar Felix Lange Committed by GitHub
Browse files

build: fix remote path for archive uploads (#3243)

archiveUpload did not handle absolute paths correctly. Fix it by using
the basename and ensure that uploads can be tested using -n.
parent 9bc97a57
No related branches found
No related tags found
No related merge requests found
......@@ -359,11 +359,11 @@ func archiveUpload(archive string, blobstore string, signer string) error {
Token: os.Getenv("AZURE_BLOBSTORE_TOKEN"),
Container: strings.SplitN(blobstore, "/", 2)[1],
}
if err := build.AzureBlobstoreUpload(archive, archive, auth); err != nil {
if err := build.AzureBlobstoreUpload(archive, filepath.Base(archive), auth); err != nil {
return err
}
if signer != "" {
if err := build.AzureBlobstoreUpload(archive+".asc", archive+".asc", auth); err != nil {
if err := build.AzureBlobstoreUpload(archive+".asc", filepath.Base(archive+".asc"), auth); err != nil {
return err
}
}
......
......@@ -16,6 +16,7 @@
package build
import (
"fmt"
"os"
"github.com/Azure/azure-sdk-for-go/storage"
......@@ -36,6 +37,11 @@ type AzureBlobstoreConfig struct {
//
// See: https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx#Anchor_3
func AzureBlobstoreUpload(path string, name string, config AzureBlobstoreConfig) error {
if *DryRunFlag {
fmt.Printf("would upload %q to %s/%s/%s\n", path, config.Account, config.Container, name)
return nil
}
// Create an authenticated client against the Azure cloud
rawClient, err := storage.NewBasicClient(config.Account, config.Token)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment