mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-06 05:30:57 +00:00
Add support for Azure package pools
This adds support for storing packages directly on Azure, with no truly "local" (on-disk) repo used. The existing Azure PublishedStorage implementation was refactored to move the shared code to a separate context struct, which can then be re-used by the new PackagePool. In addition, the files package's mockChecksumStorage was made public so that it could be used in the Azure PackagePool tests as well. Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This commit is contained in:
committed by
André Roth
parent
810df17009
commit
f9325fbc91
+19
-5
@@ -361,12 +361,26 @@ func (context *AptlyContext) PackagePool() aptly.PackagePool {
|
||||
defer context.Unlock()
|
||||
|
||||
if context.packagePool == nil {
|
||||
poolRoot := context.config().PackagePoolStorage.Path
|
||||
if poolRoot == "" {
|
||||
poolRoot = filepath.Join(context.config().RootDir, "pool")
|
||||
}
|
||||
storageConfig := context.config().PackagePoolStorage
|
||||
if storageConfig.Azure != nil {
|
||||
var err error
|
||||
context.packagePool, err = azure.NewPackagePool(
|
||||
storageConfig.Azure.AccountName,
|
||||
storageConfig.Azure.AccountKey,
|
||||
storageConfig.Azure.Container,
|
||||
storageConfig.Azure.Prefix,
|
||||
storageConfig.Azure.Endpoint)
|
||||
if err != nil {
|
||||
Fatal(err)
|
||||
}
|
||||
} else {
|
||||
poolRoot := context.config().PackagePoolStorage.Local.Path
|
||||
if poolRoot == "" {
|
||||
poolRoot = filepath.Join(context.config().RootDir, "pool")
|
||||
}
|
||||
|
||||
context.packagePool = files.NewPackagePool(poolRoot, !context.config().SkipLegacyPool)
|
||||
context.packagePool = files.NewPackagePool(poolRoot, !context.config().SkipLegacyPool)
|
||||
}
|
||||
}
|
||||
|
||||
return context.packagePool
|
||||
|
||||
Reference in New Issue
Block a user