Add support for Azure storage as a publishing backend

This adds a new configuration setting: AzurePublishEndpoints, similar
to the existing S3PublishEndpoints and SwiftPublishEndpoints.

For each endpoint, the following has to be defined:
 - accountName
 - accountKey
 - container
 - prefix

Azure tests require the following environment variables to be set:
 - AZURE_STORAGE_ACCOUNT
 - AZURE_STORAGE_ACCESS_KEY

With either of these not set, Azure-specific tests are skipped.
This commit is contained in:
chuan
2016-06-10 14:43:22 -07:00
committed by Lorenzo Bolla
parent ab2f5420c6
commit bb42a2158d
11 changed files with 817 additions and 17 deletions
+11
View File
@@ -44,6 +44,9 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
s.config.SwiftPublishRoots = map[string]SwiftPublishRoot{"test": {
Container: "repo"}}
s.config.AzurePublishRoots = map[string]AzurePublishRoot{"test": {
Container: "repo"}}
err := SaveConfig(configname, &s.config)
c.Assert(err, IsNil)
@@ -114,6 +117,14 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
" \"prefix\": \"\",\n"+
" \"container\": \"repo\"\n"+
" }\n"+
" },\n"+
" \"AzurePublishEndpoints\": {\n"+
" \"test\": {\n"+
" \"accountName\": \"\",\n"+
" \"accountKey\": \"\",\n"+
" \"container\": \"repo\",\n"+
" \"prefix\": \"\"\n"+
" }\n"+
" }\n"+
"}")
}