add support for gcs

This commit is contained in:
Pierig Le Saux
2026-03-27 19:57:25 -04:00
committed by André Roth
parent 9bb8de68d0
commit ed4af9a0f6
10 changed files with 694 additions and 1 deletions
+15
View File
@@ -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 {