@@ -76,6 +76,8 @@ const (
7676 defaultPrimeUserEnvironmentVariable = "PRIME_USER"
7777 defaultPrimePasswordEnvironmentVariable = "PRIME_PASSWORD"
7878 defaultPrimeURLEnvironmentVariable = "PRIME_URL"
79+ // New Chart Options for Autobump
80+ defaultNewChartVariable = "NEW_CHART"
7981)
8082
8183var (
@@ -133,6 +135,8 @@ var (
133135 PrimePassword string
134136 // PrimeURL of SUSE Prime registry
135137 PrimeURL string
138+ // NewChart boolean option for creating a net-new chart with auto-bump
139+ NewChart bool
136140)
137141
138142func init () {
@@ -383,6 +387,15 @@ func main() {
383387 Destination : & OverrideVersion ,
384388 EnvVar : defaultOverrideVersionEnvironmentVariable ,
385389 }
390+ newChartFlag := cli.BoolFlag {
391+ Name : "new-chart" ,
392+ Usage : `Usage:
393+ -new-chart=<false or true>
394+ ` ,
395+ Required : false ,
396+ Destination : & NewChart ,
397+ EnvVar : defaultNewChartVariable ,
398+ }
386399
387400 // Commands
388401 app .Commands = []cli.Command {
@@ -547,7 +560,7 @@ func main() {
547560 Usage : `Generate a new chart bump PR.` ,
548561 Action : chartBump ,
549562 Before : setupCache ,
550- Flags : []cli.Flag {packageFlag , branchFlag , overrideVersionFlag , multiRCFlag },
563+ Flags : []cli.Flag {packageFlag , branchFlag , overrideVersionFlag , multiRCFlag , newChartFlag },
551564 },
552565 }
553566
@@ -979,7 +992,7 @@ func lifecycleStatus(c *cli.Context) {
979992
980993 getRepoRoot ()
981994 rootFs := filesystem .GetFilesystem (RepoRoot )
982- lifeCycleDep , err := lifecycle .InitDependencies (ctx , RepoRoot , rootFs , c .String ("branch-version" ), CurrentChart )
995+ lifeCycleDep , err := lifecycle .InitDependencies (ctx , rootFs , RepoRoot , c .String ("branch-version" ), CurrentChart , false )
983996 if err != nil {
984997 logger .Fatal (ctx , fmt .Errorf ("encountered error while initializing dependencies: %w" , err ).Error ())
985998 }
@@ -1005,7 +1018,7 @@ func autoForwardPort(c *cli.Context) {
10051018 getRepoRoot ()
10061019 rootFs := filesystem .GetFilesystem (RepoRoot )
10071020
1008- lifeCycleDep , err := lifecycle .InitDependencies (ctx , RepoRoot , rootFs , c .String ("branch-version" ), CurrentChart )
1021+ lifeCycleDep , err := lifecycle .InitDependencies (ctx , rootFs , RepoRoot , c .String ("branch-version" ), CurrentChart , false )
10091022 if err != nil {
10101023 logger .Fatal (ctx , fmt .Errorf ("encountered error while initializing dependencies: %w" , err ).Error ())
10111024 }
@@ -1042,7 +1055,7 @@ func release(c *cli.Context) {
10421055 getRepoRoot ()
10431056 rootFs := filesystem .GetFilesystem (RepoRoot )
10441057
1045- dependencies , err := lifecycle .InitDependencies (ctx , RepoRoot , rootFs , c .String ("branch-version" ), CurrentChart )
1058+ dependencies , err := lifecycle .InitDependencies (ctx , rootFs , RepoRoot , c .String ("branch-version" ), CurrentChart , false )
10461059 if err != nil {
10471060 logger .Fatal (ctx , fmt .Errorf ("encountered error while initializing dependencies: %w" , err ).Error ())
10481061 }
@@ -1101,7 +1114,7 @@ func validateRelease(c *cli.Context) {
11011114 logger .Fatal (ctx , "branch must be in the format release-v2.x" )
11021115 }
11031116
1104- dependencies , err := lifecycle .InitDependencies (ctx , RepoRoot , rootFs , strings .TrimPrefix (Branch , "release-v" ), "" )
1117+ dependencies , err := lifecycle .InitDependencies (ctx , rootFs , RepoRoot , strings .TrimPrefix (Branch , "release-v" ), "" , false )
11051118 if err != nil {
11061119 logger .Fatal (ctx , fmt .Errorf ("encountered error while initializing dependencies: %w" , err ).Error ())
11071120 }
@@ -1149,12 +1162,12 @@ func chartBump(c *cli.Context) {
11491162 ChartsScriptOptionsFile = path .ConfigurationYamlFile
11501163 chartsScriptOptions := parseScriptOptions (ctx )
11511164
1152- bump , err := auto .SetupBump (ctx , RepoRoot , CurrentPackage , Branch , chartsScriptOptions )
1165+ bump , err := auto .SetupBump (ctx , RepoRoot , CurrentPackage , Branch , chartsScriptOptions , NewChart )
11531166 if err != nil {
11541167 logger .Fatal (ctx , fmt .Errorf ("failed to setup: %w" , err ).Error ())
11551168 }
11561169
1157- if err := bump .BumpChart (ctx , OverrideVersion , MultiRC ); err != nil {
1170+ if err := bump .BumpChart (ctx , OverrideVersion , MultiRC , NewChart ); err != nil {
11581171 logger .Fatal (ctx , fmt .Errorf ("failed to bump: %w" , err ).Error ())
11591172 }
11601173}
0 commit comments