mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-11-13 14:37:18 +00:00
Merge pull request #1624 from chipflake/api-codename
api/publish: allow setting custom Codename on the Release file
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -160,6 +160,8 @@ type publishedRepoCreateParams struct {
|
||||
Sources []sourceParams `binding:"required" json:"Sources"`
|
||||
// Distribution name, if missing Aptly would try to guess from sources
|
||||
Distribution string ` json:"Distribution" example:"bookworm"`
|
||||
// Value of Codename: field in published repository stanza, if missing equals Distribution
|
||||
Codename string ` json:"Codename" example:"bookworm"`
|
||||
// Value of Label: field in published repository stanza
|
||||
Label string ` json:"Label" example:""`
|
||||
// Value of Origin: field in published repository stanza
|
||||
@@ -354,6 +356,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
|
||||
if b.ButAutomaticUpgrades != "" {
|
||||
published.ButAutomaticUpgrades = b.ButAutomaticUpgrades
|
||||
}
|
||||
published.Codename = b.Codename
|
||||
published.Label = b.Label
|
||||
|
||||
published.SkipContents = context.Config().SkipContentsPublishing
|
||||
|
||||
@@ -75,7 +75,7 @@ class PublishAPITestRepo(APITest):
|
||||
self.check_exists(
|
||||
"public/" + prefix + "/pool/main/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb")
|
||||
|
||||
# publishing under root, custom distribution, architectures
|
||||
# publishing under root, custom distribution, architectures, codename
|
||||
distribution = self.random_name()
|
||||
task = self.post_task(
|
||||
"/api/publish/:.",
|
||||
@@ -85,13 +85,14 @@ class PublishAPITestRepo(APITest):
|
||||
"Signing": DefaultSigningOptions,
|
||||
"Distribution": distribution,
|
||||
"Architectures": ["i386", "amd64"],
|
||||
"Codename": distribution,
|
||||
}
|
||||
)
|
||||
self.check_task(task)
|
||||
repo2_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['amd64', 'i386'],
|
||||
'Codename': '',
|
||||
'Codename': distribution,
|
||||
'Distribution': distribution,
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
|
||||
Reference in new issue
Block a user