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
@@ -62,6 +62,7 @@ type ConfigStructure struct { // nolint: maligned
|
||||
// Storage
|
||||
FileSystemPublishRoots map[string]FileSystemPublishRoot `json:"FileSystemPublishEndpoints" yaml:"filesystem_publish_endpoints"`
|
||||
S3PublishRoots map[string]S3PublishRoot `json:"S3PublishEndpoints" yaml:"s3_publish_endpoints"`
|
||||
GCSPublishRoots map[string]GCSPublishRoot `json:"GcsPublishEndpoints" yaml:"gcs_publish_endpoints"`
|
||||
SwiftPublishRoots map[string]SwiftPublishRoot `json:"SwiftPublishEndpoints" yaml:"swift_publish_endpoints"`
|
||||
AzurePublishRoots map[string]AzureEndpoint `json:"AzurePublishEndpoints" yaml:"azure_publish_endpoints"`
|
||||
PackagePoolStorage PackagePoolStorage `json:"packagePoolStorage" yaml:"packagepool_storage"`
|
||||
@@ -189,6 +190,20 @@ type S3PublishRoot struct {
|
||||
Debug bool `json:"debug" yaml:"debug"`
|
||||
}
|
||||
|
||||
// GCSPublishRoot describes single GCS publishing entry point
|
||||
type GCSPublishRoot struct {
|
||||
Bucket string `json:"bucket" yaml:"bucket"`
|
||||
Prefix string `json:"prefix" yaml:"prefix"`
|
||||
CredentialsFile string `json:"credentialsFile" yaml:"credentials_file"`
|
||||
ServiceAccountJSON string `json:"serviceAccountJSON" yaml:"service_account_json"`
|
||||
Project string `json:"project" yaml:"project"`
|
||||
ACL string `json:"acl" yaml:"acl"`
|
||||
StorageClass string `json:"storageClass" yaml:"storage_class"`
|
||||
EncryptionKey string `json:"encryptionKey" yaml:"encryption_key"`
|
||||
DisableMultiDel bool `json:"disableMultiDel" yaml:"disable_multidel"`
|
||||
Debug bool `json:"debug" yaml:"debug"`
|
||||
}
|
||||
|
||||
// SwiftPublishRoot describes single OpenStack Swift publishing entry point
|
||||
type SwiftPublishRoot struct {
|
||||
Container string `json:"container" yaml:"container"`
|
||||
@@ -239,6 +254,7 @@ var Config = ConfigStructure{
|
||||
PpaBaseURL: "http://ppa.launchpad.net",
|
||||
FileSystemPublishRoots: map[string]FileSystemPublishRoot{},
|
||||
S3PublishRoots: map[string]S3PublishRoot{},
|
||||
GCSPublishRoots: map[string]GCSPublishRoot{},
|
||||
SwiftPublishRoots: map[string]SwiftPublishRoot{},
|
||||
AzurePublishRoots: map[string]AzureEndpoint{},
|
||||
AsyncAPI: false,
|
||||
|
||||
@@ -49,6 +49,9 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
|
||||
Region: "us-east-1",
|
||||
Bucket: "repo"}}
|
||||
|
||||
s.config.GCSPublishRoots = map[string]GCSPublishRoot{"test": {
|
||||
Bucket: "repo"}}
|
||||
|
||||
s.config.SwiftPublishRoots = map[string]SwiftPublishRoot{"test": {
|
||||
Container: "repo"}}
|
||||
|
||||
@@ -132,6 +135,20 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
|
||||
" \"debug\": false\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"GcsPublishEndpoints\": {\n" +
|
||||
" \"test\": {\n" +
|
||||
" \"bucket\": \"repo\",\n" +
|
||||
" \"prefix\": \"\",\n" +
|
||||
" \"credentialsFile\": \"\",\n" +
|
||||
" \"serviceAccountJSON\": \"\",\n" +
|
||||
" \"project\": \"\",\n" +
|
||||
" \"acl\": \"\",\n" +
|
||||
" \"storageClass\": \"\",\n" +
|
||||
" \"encryptionKey\": \"\",\n" +
|
||||
" \"disableMultiDel\": false,\n" +
|
||||
" \"debug\": false\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"SwiftPublishEndpoints\": {\n" +
|
||||
" \"test\": {\n" +
|
||||
" \"container\": \"repo\",\n" +
|
||||
@@ -275,6 +292,7 @@ func (s *ConfigSuite) TestSaveYAML2Config(c *C) {
|
||||
"skip_bz2_publishing: false\n" +
|
||||
"filesystem_publish_endpoints: {}\n" +
|
||||
"s3_publish_endpoints: {}\n" +
|
||||
"gcs_publish_endpoints: {}\n" +
|
||||
"swift_publish_endpoints: {}\n" +
|
||||
"azure_publish_endpoints: {}\n" +
|
||||
"packagepool_storage:\n" +
|
||||
@@ -352,6 +370,18 @@ s3_publish_endpoints:
|
||||
force_sigv2: true
|
||||
force_virtualhosted_style: true
|
||||
debug: true
|
||||
gcs_publish_endpoints:
|
||||
test:
|
||||
bucket: gcs-bucket
|
||||
prefix: pre-gcs
|
||||
credentials_file: /tmp/creds.json
|
||||
service_account_json: '{"type":"service_account"}'
|
||||
project: test-project
|
||||
acl: public-read
|
||||
storage_class: STANDARD
|
||||
encryption_key: "12345678901234567890123456789012"
|
||||
disable_multidel: true
|
||||
debug: true
|
||||
swift_publish_endpoints:
|
||||
test:
|
||||
container: c1
|
||||
|
||||
Reference in New Issue
Block a user