Add support for custom package pool locations

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This commit is contained in:
Ryan Gonzalez
2022-04-28 16:14:34 -05:00
committed by André Roth
parent 91574b53d9
commit 8e37813129
7 changed files with 29 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ type ConfigStructure struct { // nolint: maligned
GpgDisableVerify bool `json:"gpgDisableVerify"`
GpgProvider string `json:"gpgProvider"`
DownloadSourcePackages bool `json:"downloadSourcePackages"`
PackagePoolStorage PackagePool `json:"packagePoolStorage"`
SkipLegacyPool bool `json:"skipLegacyPool"`
PpaDistributorID string `json:"ppaDistributorID"`
PpaCodename string `json:"ppaCodename"`
@@ -40,6 +41,10 @@ type ConfigStructure struct { // nolint: maligned
ServeInAPIMode bool `json:"serveInAPIMode"`
}
type PackagePool struct {
Path string `json:"path"`
}
// FileSystemPublishRoot describes single filesystem publishing entry point
type FileSystemPublishRoot struct {
RootDir string `json:"rootDir"`
@@ -106,6 +111,7 @@ var Config = ConfigStructure{
GpgDisableSign: false,
GpgDisableVerify: false,
DownloadSourcePackages: false,
PackagePoolStorage: PackagePool{Path: ""},
SkipLegacyPool: false,
PpaDistributorID: "ubuntu",
PpaCodename: "",

View File

@@ -34,6 +34,8 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
s.config.DatabaseOpenAttempts = 5
s.config.GpgProvider = "gpg"
s.config.PackagePoolStorage.Path = "/tmp/aptly-pool"
s.config.FileSystemPublishRoots = map[string]FileSystemPublishRoot{"test": {
RootDir: "/opt/aptly-publish"}}
@@ -78,6 +80,9 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
" \"gpgDisableVerify\": false,\n"+
" \"gpgProvider\": \"gpg\",\n"+
" \"downloadSourcePackages\": false,\n"+
" \"packagePoolStorage\": {\n"+
" \"path\": \"/tmp/aptly-pool\"\n"+
" },\n"+
" \"skipLegacyPool\": false,\n"+
" \"ppaDistributorID\": \"\",\n"+
" \"ppaCodename\": \"\",\n"+