Skip to content

Commit ae4e5d1

Browse files
authored
APP-1675 - Enhance update application version command with source fla… (#63)
* APP-1675 - Refactor source and filter parsing into shared standalone functions * APP-1675 - Add version-update-sources command for draft version source updates * APP-1673 - Added e2e for updating draft version sources
1 parent de92ba6 commit ae4e5d1

18 files changed

Lines changed: 1159 additions & 440 deletions

apptrust/commands/flags.go

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ import (
88
)
99

1010
const (
11-
Ping = "ping"
12-
VersionCreate = "version-create"
13-
VersionPromote = "version-promote"
14-
VersionRollback = "version-rollback"
15-
VersionDelete = "version-delete"
16-
VersionRelease = "version-release"
17-
VersionUpdate = "version-update"
18-
PackageBind = "package-bind"
19-
PackageUnbind = "package-unbind"
20-
AppCreate = "app-create"
21-
AppUpdate = "app-update"
22-
AppDelete = "app-delete"
11+
Ping = "ping"
12+
VersionCreate = "version-create"
13+
VersionPromote = "version-promote"
14+
VersionRollback = "version-rollback"
15+
VersionDelete = "version-delete"
16+
VersionRelease = "version-release"
17+
VersionUpdate = "version-update"
18+
VersionUpdateSources = "version-update-sources"
19+
PackageBind = "package-bind"
20+
PackageUnbind = "package-unbind"
21+
AppCreate = "app-create"
22+
AppUpdate = "app-update"
23+
AppDelete = "app-delete"
2324
)
2425

2526
const (
@@ -44,6 +45,7 @@ const (
4445
SyncFlag = "sync"
4546
PromotionTypeFlag = "promotion-type"
4647
DryRunFlag = "dry-run"
48+
FailFastFlag = "fail-fast"
4749
ExcludeReposFlag = "exclude-repos"
4850
IncludeReposFlag = "include-repos"
4951
PropsFlag = "props"
@@ -85,6 +87,7 @@ var flagsMap = map[string]components.Flag{
8587
SyncFlag: components.NewBoolFlag(SyncFlag, "Whether to synchronize the operation.", components.WithBoolDefaultValueTrue()),
8688
PromotionTypeFlag: components.NewStringFlag(PromotionTypeFlag, "The promotion type. The following values are supported: "+coreutils.ListToText(model.PromotionTypeValues), func(f *components.StringFlag) { f.Mandatory = false; f.DefaultValue = model.PromotionTypeCopy }),
8789
DryRunFlag: components.NewBoolFlag(DryRunFlag, "Perform a simulation of the operation.", components.WithBoolDefaultValueFalse()),
90+
FailFastFlag: components.NewBoolFlag(FailFastFlag, "Stop the operation on the first error. Only relevant when sources are provided.", components.WithBoolDefaultValueTrue()),
8891
ExcludeReposFlag: components.NewStringFlag(ExcludeReposFlag, "Semicolon-separated list of repositories to exclude.", func(f *components.StringFlag) { f.Mandatory = false }),
8992
IncludeReposFlag: components.NewStringFlag(IncludeReposFlag, "Semicolon-separated list of repositories to include.", func(f *components.StringFlag) { f.Mandatory = false }),
9093
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 }),
@@ -168,6 +171,24 @@ var commandFlags = map[string][]string{
168171
PropertiesFlag,
169172
DeletePropertiesFlag,
170173
},
174+
VersionUpdateSources: {
175+
url,
176+
user,
177+
accessToken,
178+
serverId,
179+
SyncFlag,
180+
DryRunFlag,
181+
FailFastFlag,
182+
SourceTypeBuildsFlag,
183+
SourceTypeReleaseBundlesFlag,
184+
SourceTypeApplicationVersionsFlag,
185+
SourceTypePackagesFlag,
186+
SourceTypeArtifactsFlag,
187+
SpecFlag,
188+
SpecVarsFlag,
189+
IncludeFilterFlag,
190+
ExcludeFilterFlag,
191+
},
171192

172193
PackageBind: {
173194
url,

0 commit comments

Comments
 (0)