Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apptrust/commands/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ var flagsMap = map[string]components.Flag{
IncludeReposFlag: components.NewStringFlag(IncludeReposFlag, "Semicolon-separated list of repositories to include.", func(f *components.StringFlag) { f.Mandatory = false }),
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 }),
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 }),
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 }),
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 }),
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 }),
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 }),
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 }),
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 }),
DeletePropertiesFlag: components.NewStringFlag(DeletePropertiesFlag, "Remove a property key and all its values", func(f *components.StringFlag) { f.Mandatory = false }),
Expand Down
12 changes: 8 additions & 4 deletions apptrust/commands/version/create_app_version_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ func (cv *createAppVersionCommand) parseBuilds(buildsStr string) ([]model.Create

func (cv *createAppVersionCommand) parseReleaseBundles(rbStr string) ([]model.CreateVersionReleaseBundle, error) {
const (
nameField = "name"
versionField = "version"
projectKeyField = "project-key"
repoKeyField = "repo-key"
nameField = "name"
versionField = "version"
)

var bundles []model.CreateVersionReleaseBundle
Expand All @@ -203,8 +205,10 @@ func (cv *createAppVersionCommand) parseReleaseBundles(rbStr string) ([]model.Cr
return nil, errorutils.CheckErrorf("invalid release bundle format: %v", err)
}
bundles = append(bundles, model.CreateVersionReleaseBundle{
Name: releaseBundleEntryMap[nameField],
Version: releaseBundleEntryMap[versionField],
ProjectKey: releaseBundleEntryMap[projectKeyField],
RepositoryKey: releaseBundleEntryMap[repoKeyField],
Name: releaseBundleEntryMap[nameField],
Version: releaseBundleEntryMap[versionField],
})
}
return bundles, nil
Expand Down
8 changes: 8 additions & 0 deletions apptrust/commands/version/create_app_version_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,14 @@ func TestParseReleaseBundles(t *testing.T) {
expectError: true,
errorContains: "invalid release bundle format",
},
{
name: "with project-key and repo-key",
input: "name=rb1,version=1.0.0,project-key=proj1,repo-key=repo1",
expectError: false,
expectedReleaseBundles: []model.CreateVersionReleaseBundle{
{Name: "rb1", Version: "1.0.0", ProjectKey: "proj1", RepositoryKey: "repo1"},
},
},
}

for _, tt := range tests {
Expand Down
Loading