Skip to content

Commit 5fb5716

Browse files
committed
feat: update sumdb and dependencies
Signed-off-by: Chen Keinan <hen.keinan@gmail.com>
1 parent 21a8df1 commit 5fb5716

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ require (
6262
gopkg.in/yaml.v3 v3.0.1 // indirect
6363
)
6464

65-
replace github.com/OctopusDeploy/go-octopusdeploy/v2 => /Users/chenkeinan/work/go-octopusdeploy
65+
replace github.com/OctopusDeploy/go-octopusdeploy/v2 => github.com/chen-keinan/go-octopusdeploy/v2 v2.0.0-20260215141226-f0761d37b8a3

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ github.com/bmatcuk/doublestar/v4 v4.4.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTS
5151
github.com/briandowns/spinner v1.19.0 h1:s8aq38H+Qju89yhp89b4iIiMzMm8YN3p6vGpwyh/a8E=
5252
github.com/briandowns/spinner v1.19.0/go.mod h1:mQak9GHqbspjC/5iUx3qMlIho8xBS/ppAL/hX5SmPJU=
5353
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
54+
github.com/chen-keinan/go-octopusdeploy/v2 v2.0.0-20260215141226-f0761d37b8a3 h1:M0JgP8bc/Q4/BO1jExusi3Mr9h9W037TB/Qby+lYZ6Q=
55+
github.com/chen-keinan/go-octopusdeploy/v2 v2.0.0-20260215141226-f0761d37b8a3/go.mod h1:VkTXDoIPbwGFi5+goo1VSwFNdMVo784cVtJdKIEvfus=
5456
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
5557
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
5658
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=

pkg/cmd/release/promote/promote.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ func NewCmdPromote(f factory.Factory) *cobra.Command {
150150
promoteFlags := NewPromoteFlags()
151151
cmd := &cobra.Command{
152152
Use: "promote",
153-
Short: "Promote releases",
154-
Long: "Promote releases in Octopus Deploy",
153+
Short: "Promote release",
154+
Long: "Promote release in Octopus Deploy",
155155
Example: heredoc.Docf(`
156156
$ %[1]s release promote # fully interactive
157157
$ %[1]s release promote -p MyProject --version 1.0 -source-env Dev -e Staging --environment Production --skip InstallStep --variable VarName:VarValue
@@ -435,20 +435,8 @@ func AskQuestions(octopus *octopusApiClient.Client, stdout io.Writer, asker ques
435435
return err
436436
}
437437

438-
// select release
439-
440438
var selectedRelease *releases.Release
441439
var selectedChannel *channels.Channel
442-
if options.SourceEnvironment == "" {
443-
selectedSourceEnvironment, err := selectors.EnvironmentSelect(asker, func() ([]*environments.Environment, error) {
444-
return selectors.GetAllEnvironments(octopus)
445-
}, "Select source environment")
446-
if err != nil {
447-
return err
448-
}
449-
_, _ = fmt.Fprintf(stdout, "Source Environment %s\n", output.Cyan(selectedSourceEnvironment.Name))
450-
options.SourceEnvironment = selectedSourceEnvironment.Name
451-
}
452440
if options.ReleaseVersion == "" {
453441
// first we want to ask them to pick a channel just to narrow down the search space for releases (not sent to server)
454442
selectedChannel, err = selectors.Channel(octopus, asker, stdout, "Select channel", selectedProject)
@@ -484,6 +472,16 @@ func AskQuestions(octopus *octopusApiClient.Client, stdout io.Writer, asker ques
484472
}
485473
}
486474

475+
if options.SourceEnvironment == "" {
476+
selectedSourceEnvironment, err := selectors.EnvironmentSelect(asker, func() ([]*environments.Environment, error) {
477+
return selectors.GetAllEnvironments(octopus)
478+
}, "Select source environment")
479+
if err != nil {
480+
return err
481+
}
482+
_, _ = fmt.Fprintf(stdout, "Source Environment %s\n", output.Cyan(selectedSourceEnvironment.Name))
483+
options.SourceEnvironment = selectedSourceEnvironment.Name
484+
}
487485
// machine selection later on needs to refer back to the environments.
488486
// NOTE: this is allowed to remain nil; environments will get looked up later on if needed
489487
var deploymentEnvironmentIDs []string

0 commit comments

Comments
 (0)