watch: build & launch the project at start#10957
Merged
milas merged 1 commit intodocker:mainfrom Sep 7, 2023
Merged
Conversation
Contributor
Author
|
This is rebased and good to go! (Sidenote: IntelliJ's local history feature saved me because I accidentally deleted most of this when splitting it from #10956 😬) |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #10957 +/- ##
==========================================
- Coverage 58.30% 57.59% -0.71%
==========================================
Files 124 127 +3
Lines 10912 11068 +156
==========================================
+ Hits 6362 6375 +13
- Misses 3922 4061 +139
- Partials 628 632 +4
☔ View full report in Codecov by Sentry. |
The `alpha watch` command current "attaches" to an already-running Compose project, so it's necessary to run something like `docker compose up --wait` first. Now, we'll do the equivalent of an `up --build` before starting the watch, so that we know the project is up-to-date and running. Additionally, unlike an interactive `up`, the services are not stopped when `watch` exits (e.g. via `Ctrl-C`). This prevents the need to start from scratch each time the command is run - if some services are already running and up-to-date, they can be used as-is. A `down` can always be used to destroy everything, and we can consider introducing a flag like `--down-on-exit` to `watch` or changing the default. Signed-off-by: Milas Bowman <[email protected]>
ndeloof
approved these changes
Sep 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
The
alpha watchcommand current "attaches" to an already-running Compose project, so it's necessary to run something likedocker compose up --waitfirst.Now, we'll do the equivalent of an
up --buildbefore starting the watch, so that we know the project is up-to-date and running.Additionally, unlike an interactive
up, the services are not stopped whenwatchexits (e.g. viaCtrl-C). This prevents the need to start from scratch each time the command is run - if some services are already running and up-to-date, they can be used as-is. Adowncan always be used to destroy everything, and we can consider introducing a flag like--down-on-exittowatchor changing the default.NOTE: This requires #10956, so it won't even build until that's merged 😬
Related issue
https://docker.atlassian.net/browse/ENV-286
(not mandatory) A picture of a cute animal, if possible in relation to what you did
