Skip to content

Commit f743642

Browse files
committed
Allow passing project key and repository key with release bundle sources
1 parent 154641e commit f743642

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

apptrust/commands/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ var flagsMap = map[string]components.Flag{
7979
IncludeReposFlag: components.NewStringFlag(IncludeReposFlag, "Semicolon-separated list of repositories to include.", func(f *components.StringFlag) { f.Mandatory = false }),
8080
PropsFlag: components.NewStringFlag(PropsFlag, "Semicolon-separated list of properties in the form of 'key1=value1;key2=value2;...' to be added to each artifact.", func(f *components.StringFlag) { f.Mandatory = false }),
8181
TagFlag: components.NewStringFlag(TagFlag, "A tag to associate with the version. Must contain only alphanumeric characters, hyphens (-), underscores (_), and dots (.).", func(f *components.StringFlag) { f.Mandatory = false }),
82-
SourceTypeBuildsFlag: components.NewStringFlag(SourceTypeBuildsFlag, "List of semicolon-separated (;) builds in the form of 'name=buildName1, id=runID1, [include-deps=true]; name=buildName2, id=runID2, [include-deps=true]' to be included in the new version.", func(f *components.StringFlag) { f.Mandatory = false }),
83-
SourceTypeReleaseBundlesFlag: components.NewStringFlag(SourceTypeReleaseBundlesFlag, "List of semicolon-separated (;) release bundles in the form of 'name=releaseBundleName1, version=version1; name=releaseBundleName2, version=version2' to be included in the new version.", func(f *components.StringFlag) { f.Mandatory = false }),
82+
SourceTypeBuildsFlag: components.NewStringFlag(SourceTypeBuildsFlag, "List of semicolon-separated (;) builds in the form of 'name=buildName1, id=runID1[, include-deps=true]; name=buildName2, id=runID2[, include-deps=true]' to be included in the new version.", func(f *components.StringFlag) { f.Mandatory = false }),
83+
SourceTypeReleaseBundlesFlag: components.NewStringFlag(SourceTypeReleaseBundlesFlag, "List of semicolon-separated (;) release bundles in the form of 'name=releaseBundleName1, version=version1[, project-key=project1][, repo-key=repo1]; name=releaseBundleName2, version=version2[, project-key=project2][, repo-key=repo2]' to be included in the new version.", func(f *components.StringFlag) { f.Mandatory = false }),
8484
SourceTypeApplicationVersionsFlag: components.NewStringFlag(SourceTypeApplicationVersionsFlag, "List of semicolon-separated (;) application versions in the form of 'application-key=app1, version=version1; application-key=app2, version=version2' to be included in the new version.", func(f *components.StringFlag) { f.Mandatory = false }),
8585
PropertiesFlag: components.NewStringFlag(PropertiesFlag, "Sets or updates custom properties for the application version in format 'key1=value1[,value2,...];key2=value3[,value4,...]'", func(f *components.StringFlag) { f.Mandatory = false }),
8686
DeletePropertiesFlag: components.NewStringFlag(DeletePropertiesFlag, "Remove a property key and all its values", func(f *components.StringFlag) { f.Mandatory = false }),

apptrust/commands/version/create_app_version_cmd.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,10 @@ func (cv *createAppVersionCommand) parseBuilds(buildsStr string) ([]model.Create
187187

188188
func (cv *createAppVersionCommand) parseReleaseBundles(rbStr string) ([]model.CreateVersionReleaseBundle, error) {
189189
const (
190-
nameField = "name"
191-
versionField = "version"
190+
projectKeyField = "project-key"
191+
repoKeyField = "repo-key"
192+
nameField = "name"
193+
versionField = "version"
192194
)
193195

194196
var bundles []model.CreateVersionReleaseBundle
@@ -203,8 +205,10 @@ func (cv *createAppVersionCommand) parseReleaseBundles(rbStr string) ([]model.Cr
203205
return nil, errorutils.CheckErrorf("invalid release bundle format: %v", err)
204206
}
205207
bundles = append(bundles, model.CreateVersionReleaseBundle{
206-
Name: releaseBundleEntryMap[nameField],
207-
Version: releaseBundleEntryMap[versionField],
208+
ProjectKey: releaseBundleEntryMap[projectKeyField],
209+
RepositoryKey: releaseBundleEntryMap[repoKeyField],
210+
Name: releaseBundleEntryMap[nameField],
211+
Version: releaseBundleEntryMap[versionField],
208212
})
209213
}
210214
return bundles, nil

0 commit comments

Comments
 (0)