-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow deploy
without prior stage
when FORCE_DEPLOY
environment is true
#72
Conversation
A pattern that is used with stratus may be to `stage` in branch builds, and `deploy` in default branch builds. Upon disasters, like accidental stack deletions, retrying the default branch to re-create the infrastructure, without worrying about making a temporary branch and staging, would be a fast path to recovery.
deploy
without prior stage
deploy
without prior stage
when FORCE_DEPLOY
environment is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
internal/command/deploy.go
Outdated
@@ -16,8 +18,18 @@ func Deploy( | |||
logger.Title("Find existing change set") | |||
|
|||
changeSet, err := client.FindExistingChangeSet(ctx, stack) | |||
|
|||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit rusty, are there any scenarios where err != nil
apart from the change set not existing, where we should continue to short circuit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there's a few exceptional things that could be bubbled from AWS SDK calls. Would be the pattern here to define a custom error? My go is rustier (in the sense it never existed) than your stratus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm too far detached to speak to idiomatic Go, but I'd be supportive of smuggling through an additional changeSet == nil, err == nil
state for "change set does not exist".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
A pattern that is used with stratus may be to
stage
in branch builds, anddeploy
in default branch builds.Upon disasters, like accidental stack deletions or failed changes, retrying a build on a default branch to re-create the infrastructure or roll back, without worrying about making a temporary branch and staging, would be a fast path to recovery. This PR allows this to happen if and only if stratus finds a
FORCE_DEPLOY
environment variable set totrue
.Is this worth documenting? The error message will tell you what to do in a pinch.