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

View File

@@ -30,6 +30,7 @@ type ConfigStructure struct { // nolint: maligned
FileSystemPublishRoots map[string]FileSystemPublishRoot `json:"FileSystemPublishEndpoints"`
S3PublishRoots map[string]S3PublishRoot `json:"S3PublishEndpoints"`
SwiftPublishRoots map[string]SwiftPublishRoot `json:"SwiftPublishEndpoints"`
AzurePublishRoots map[string]AzurePublishRoot `json:"AzurePublishEndpoints"`
}
// FileSystemPublishRoot describes single filesystem publishing entry point
@@ -72,6 +73,14 @@ type SwiftPublishRoot struct {
Container string `json:"container"`
}
// AzurePublishRoot describes single Azure publishing entry point
type AzurePublishRoot struct {
AccountName string `json:"accountName"`
AccountKey string `json:"accountKey"`
Container string `json:"container"`
Prefix string `json:"prefix"`
}
// Config is configuration for aptly, shared by all modules
var Config = ConfigStructure{
RootDir: filepath.Join(os.Getenv("HOME"), ".aptly"),
@@ -93,6 +102,7 @@ var Config = ConfigStructure{
FileSystemPublishRoots: map[string]FileSystemPublishRoot{},
S3PublishRoots: map[string]S3PublishRoot{},
SwiftPublishRoots: map[string]SwiftPublishRoot{},
AzurePublishRoots: map[string]AzurePublishRoot{},
}
// LoadConfig loads configuration from json file