From 4db1b2c059d99177cdd3c1858aac6a3859e0e64b Mon Sep 17 00:00:00 2001 From: marpio Date: Fri, 30 Aug 2019 22:11:03 +0200 Subject: [PATCH 1/6] _ is invalid in container names - use - --- pkg/stash/with_azureblob_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stash/with_azureblob_test.go b/pkg/stash/with_azureblob_test.go index 08a724126..b609065c6 100644 --- a/pkg/stash/with_azureblob_test.go +++ b/pkg/stash/with_azureblob_test.go @@ -105,7 +105,7 @@ func randomContainerName(prefix string) string { // see https://github.com/technosophos/moniker for more details namer := moniker.New() if prefix != "" { - return fmt.Sprintf("%s_%s", prefix, namer.NameSep("")) + return fmt.Sprintf("%s-%s", prefix, namer.NameSep("")) } return namer.NameSep("") } From 197bf934c875a8e416c4cdbcd2afdb5649ad9e30 Mon Sep 17 00:00:00 2001 From: marpio Date: Fri, 30 Aug 2019 22:20:46 +0200 Subject: [PATCH 2/6] change var name so it maches drone --- pkg/stash/with_azureblob_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stash/with_azureblob_test.go b/pkg/stash/with_azureblob_test.go index b609065c6..815cf4e1b 100644 --- a/pkg/stash/with_azureblob_test.go +++ b/pkg/stash/with_azureblob_test.go @@ -89,7 +89,7 @@ func getAzureTestConfig(containerName string) *config.AzureBlobConfig { if key == "" { return nil } - name := os.Getenv("ATHENS_AZURE_ACCOUNT_NAME") + name := os.Getenv("AZURE_ACCOUNT_NAME") if name == "" { return nil } From b6911ab8a2cfb2d99ec6f7528a499bdc3dc49120 Mon Sep 17 00:00:00 2001 From: marpio Date: Fri, 30 Aug 2019 22:31:54 +0200 Subject: [PATCH 3/6] add logs to see why drone isn't exec the tests --- pkg/stash/with_azureblob_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/stash/with_azureblob_test.go b/pkg/stash/with_azureblob_test.go index 815cf4e1b..0112e1dfc 100644 --- a/pkg/stash/with_azureblob_test.go +++ b/pkg/stash/with_azureblob_test.go @@ -21,7 +21,8 @@ import ( // is done synchronously so that only the first module gets saved. func TestWithAzureBlob(t *testing.T) { containerName := randomContainerName(os.Getenv("DRONE_PULL_REQUEST")) - cfg := getAzureTestConfig(containerName) + + cfg := getAzureTestConfig(t, containerName) if cfg == nil { t.SkipNow() } @@ -84,13 +85,15 @@ func (ms *mockAzureBlobStasher) Stash(ctx context.Context, mod, ver string) (str return "", fmt.Errorf("second time error") } -func getAzureTestConfig(containerName string) *config.AzureBlobConfig { +func getAzureTestConfig(t *testing.T, containerName string) *config.AzureBlobConfig { key := os.Getenv("ATHENS_AZURE_ACCOUNT_KEY") if key == "" { + t.Log("ATHENS_AZURE_ACCOUNT_KEY not provided.") return nil } name := os.Getenv("AZURE_ACCOUNT_NAME") if name == "" { + t.Log("AZURE_ACCOUNT_NAME not provided.") return nil } return &config.AzureBlobConfig{ From 11b828dabb5a1e9d5b67aeb44689ae7a940b3508 Mon Sep 17 00:00:00 2001 From: marpio Date: Fri, 30 Aug 2019 22:42:49 +0200 Subject: [PATCH 4/6] use accou t name --- pkg/stash/with_azureblob_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stash/with_azureblob_test.go b/pkg/stash/with_azureblob_test.go index 0112e1dfc..c71ad22a1 100644 --- a/pkg/stash/with_azureblob_test.go +++ b/pkg/stash/with_azureblob_test.go @@ -91,7 +91,7 @@ func getAzureTestConfig(t *testing.T, containerName string) *config.AzureBlobCon t.Log("ATHENS_AZURE_ACCOUNT_KEY not provided.") return nil } - name := os.Getenv("AZURE_ACCOUNT_NAME") + name := "athens" //os.Getenv("AZURE_ACCOUNT_NAME") if name == "" { t.Log("AZURE_ACCOUNT_NAME not provided.") return nil From 763532bad4458756328ffc670fa09ed7f6980142 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Thu, 19 Dec 2019 13:08:38 -0800 Subject: [PATCH 5/6] Using the existing AZURE_ACCOUNT_NAME env var But falling back to 'athens' if it's not set --- pkg/stash/with_azureblob_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/stash/with_azureblob_test.go b/pkg/stash/with_azureblob_test.go index c71ad22a1..a6abd7d6f 100644 --- a/pkg/stash/with_azureblob_test.go +++ b/pkg/stash/with_azureblob_test.go @@ -91,10 +91,10 @@ func getAzureTestConfig(t *testing.T, containerName string) *config.AzureBlobCon t.Log("ATHENS_AZURE_ACCOUNT_KEY not provided.") return nil } - name := "athens" //os.Getenv("AZURE_ACCOUNT_NAME") + name := os.Getenv("AZURE_ACCOUNT_NAME") if name == "" { - t.Log("AZURE_ACCOUNT_NAME not provided.") - return nil + t.Log("AZURE_ACCOUNT_NAME not provided, falling back to 'athens'.") + name = "athens" } return &config.AzureBlobConfig{ AccountName: name, From 748c7f0274ffce228dd31c620fbe7a7d7caebcfb Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Tue, 17 Mar 2020 16:52:24 -0700 Subject: [PATCH 6/6] changing the name of the Azure account name env var --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9beb1aaf3..dfd9e7c71 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,8 +50,8 @@ steps: from_secret: GCS_SERVICE_ACCOUNT GCS_PROJECT_ID: from_secret: GOOGLE_CLOUD_PROJECT - ATHENS_AZURE_ACCOUNT_NAME: - from_secret: ATHENS_AZURE_ACCOUNT_NAME + ATHENS_ACCOUNT_NAME: + from_secret: AZURE_ACCOUNT_NAME ATHENS_AZURE_ACCOUNT_KEY: from_secret: ATHENS_AZURE_ACCOUNT_KEY when: