Skip to content

Commit 5363995

Browse files
authored
Merge pull request #3642 from buildkite/pb-1008-add-custom-azure-blob-storage-container-artifact-upload
2 parents 6acdd34 + 887d593 commit 5363995

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

internal/e2e/artifact_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,19 @@ func TestArtifactUploadDownload_GCS(t *testing.T) {
5353
t.Errorf("Build state = %q, want %q", got, want)
5454
}
5555
}
56+
57+
// Test that we can upload/downdload artifact using a custom Azure Blob storage
58+
// container.
59+
// Everything that gets uploaded here gets auto removed in 30 days.
60+
func TestArtifactUploadDownload_Azure(t *testing.T) {
61+
ctx := t.Context()
62+
tc := newTestCase(t, "artifact_custom_azure_storage.yaml")
63+
64+
tc.startAgent()
65+
build := tc.triggerBuild()
66+
state := tc.waitForBuild(ctx, build)
67+
68+
if got, want := state, "passed"; got != want {
69+
t.Errorf("Build state = %q, want %q", got, want)
70+
}
71+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
env:
2+
BUILDKITE_ARTIFACT_UPLOAD_DESTINATION: "https://l0srwtxpsx7s9h26qra8a40j.blob.core.windows.net/buildkite-agent-e2e-test/${BUILDKITE_PIPELINE_ID}"
3+
4+
agents:
5+
queue: {{ .queue }}
6+
7+
secrets:
8+
- AZURE_E2E_TEST_KEY
9+
10+
steps:
11+
- key: upload
12+
commands: |
13+
set -e
14+
echo "hello world" > artifact.txt
15+
BUILDKITE_AZURE_BLOB_ACCESS_KEY="$${AZURE_E2E_TEST_KEY}" {{ .buildkite_agent_binary }} artifact upload artifact.txt
16+
- key: download
17+
depends_on: upload
18+
commands: |
19+
set -e
20+
BUILDKITE_AZURE_BLOB_ACCESS_KEY="$${AZURE_E2E_TEST_KEY}" {{ .buildkite_agent_binary }} artifact download artifact.txt .
21+
[[ $(cat artifact.txt) == "hello world" ]]

0 commit comments

Comments
 (0)