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.
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user