Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add deployment freeze override flags #463

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bec-callow-oct
Copy link

Background

[SC-96959]

Deployment freeze overrides for Octopus Server API were implemented in this PR, but there is currently no way to override a deployment freeze via the CLI.

This PR adds two new flags to the deploy release command. If deploying while a deployment freeze is active, both of these flags are required:
deployment-freeze-names and deployment-freeze-override-reason

Results

Before

$ ./octopus release deploy --project "Freeze test" --version 0.0.2 --environment Dev

Automation Command: octopus release deploy --project 'Freeze test' --version '0.0.2' --environment 'Dev' --no-prompt
Octopus API error: There was a problem with your request. [The environment Dev is frozen by freeze 1.]

After

When a deployment freeze exists

$ ./octopus release deploy --project "Freeze test" --version 0.0.2 --environment Dev --deployment-freeze-names "freeze 1" --deployment-freeze-override-reason "testing"

Automation Command: octopus release deploy --project 'Freeze test' --version '0.0.2' --environment 'Dev' --deployment-freeze-names 'freeze 1' --deployment-freeze-override-reason 'testing' --no-prompt
Successfully started 1 deployment(s)

When the deployment freeze is not found

$ ./octopus release deploy --project "Freeze test" --version 0.0.2 --environment Dev --deployment-freeze-names "fake freeze" --deployment-freeze-override-reason "testing"

Automation Command: octopus release deploy --project 'Freeze test' --version '0.0.2' --environment 'Dev' --deployment-freeze-names 'fake freeze' --deployment-freeze-override-reason 'testing' --no-prompt
Octopus API error: There was a problem with your request. [Unable to override freezes, no valid freezes were specified]

@@ -82,6 +82,9 @@ const (

FlagUpdateVariables = "update-variables"
FlagAliasUpdateVariablesLegacy = "updateVariables"

FlagDeploymentFreezeNames = "deployment-freeze-names"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be singular, each instance of the parameter is single freeze name, which can be specified multiple times.

Suggested change
FlagDeploymentFreezeNames = "deployment-freeze-names"
FlagDeploymentFreezeName = "deployment-freeze-name"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants