-
Notifications
You must be signed in to change notification settings - Fork 391
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
chore: allow initializing and deploying environments with copilot deploy #5215
Conversation
Co-authored-by: Penghao He <penghaoh@amazon.com>
🍕 Here are the new binary sizes!
|
edb7c26
to
3b4b78f
Compare
chore: begin work
chore: fix compilation errors chore: undo changes to LocalEnvSelector chore: fix env selector
3b4b78f
to
67e5d46
Compare
Codecov Report
@@ Coverage Diff @@
## mainline #5215 +/- ##
============================================
- Coverage 69.83% 69.80% -0.04%
============================================
Files 296 296
Lines 44326 44518 +192
Branches 286 286
============================================
+ Hits 30955 31074 +119
- Misses 11875 11942 +67
- Partials 1496 1502 +6
|
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.
LGTM awesome!
return fmt.Errorf("env %s does not exist in app %s", o.envName, o.appName) | ||
} | ||
|
||
func (o *deployOpts) maybeDeployEnv() error { |
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 think one case that this does not handle is this:
$copilot deploy
Which env?
> test (initted, but not in workspace and not-yet deployed)
# Error when trying to deploy svc to "test", because the test env isn't deployed yet.
I think it is fine to not handle this case, at least not for this release though! I just want to call out that this might be something that we want to support. But again, not a blocking issue at all.
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.
understood. I think there may be a big refactor of the init and deploy experiences coming soonish and we could better support this case. as of right now though I don't think we have special checks in place to see whether the env is initted but not deployed even in copilot svc deploy
or the like.
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.
It is done here!
copilot-cli/internal/pkg/cli/svc_deploy.go
Line 511 in 7ae7953
if currVersion == version.EnvTemplateBootstrap { |
There were a few changes regarding what env init
do in the last year. env init
, in addition to create SSM parameters, it also deploys an environment stack that contains _only) env manager role and cfn execution role - sort of like the CDK bootstrap stack.
The bootstrap stack's template "version" is a special string and can be used to determine the state of an environment.
This is just a note for future refactor! Not a request to update this PR
Co-authored-by: Wanxian Yang <79273084+Lou1415926@users.noreply.github.com>
…loy (aws#5215) Milestone 2 of the deploy enhancements. This allows customers to initialize and deploy environments during copilot deploy. for example ```sh copilot deploy --deploy-env --env dev --name frontend ``` The new logic is as follows. 1. Prompt for workload name, including uninitialized local workloads. 2. Prompt for environment name, including uninitialized local environments. 3. Check whether the selected environment exists and set some flags (envExistsInApp and envExistsINWs) 4. If the env doesn't exist, initialize it. 5. If the env was just initialized, immediately proceed to deploying it. Otherwise, prompt for deploying the environment. 6. If the workload doesn't exist, prompt for initializing it. 7. Deploy the workload. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
Milestone 2 of the deploy enhancements. This allows customers to initialize and deploy environments during copilot deploy.
for example
The new logic is as follows.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.