mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-15 11:57:59 +00:00
add support for gcs
This commit is contained in:
committed by
André Roth
parent
9bb8de68d0
commit
ed4af9a0f6
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/aptly-dev/aptly/database/goleveldb"
|
||||
"github.com/aptly-dev/aptly/deb"
|
||||
"github.com/aptly-dev/aptly/files"
|
||||
"github.com/aptly-dev/aptly/gcs"
|
||||
"github.com/aptly-dev/aptly/http"
|
||||
"github.com/aptly-dev/aptly/pgp"
|
||||
"github.com/aptly-dev/aptly/s3"
|
||||
@@ -437,6 +438,20 @@ func (context *AptlyContext) GetPublishedStorage(name string) aptly.PublishedSto
|
||||
if err != nil {
|
||||
Fatal(err)
|
||||
}
|
||||
} else if strings.HasPrefix(name, "gcs:") {
|
||||
params, ok := context.config().GCSPublishRoots[name[4:]]
|
||||
if !ok {
|
||||
Fatal(fmt.Errorf("published GCS storage %v not configured", name[4:]))
|
||||
}
|
||||
|
||||
var err error
|
||||
publishedStorage, err = gcs.NewPublishedStorage(
|
||||
params.Bucket, params.Prefix, params.CredentialsFile, params.ServiceAccountJSON,
|
||||
params.Project, params.ACL, params.StorageClass, params.EncryptionKey,
|
||||
params.DisableMultiDel, params.Debug)
|
||||
if err != nil {
|
||||
Fatal(err)
|
||||
}
|
||||
} else if strings.HasPrefix(name, "swift:") {
|
||||
params, ok := context.config().SwiftPublishRoots[name[6:]]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user