feat(#9261): add --project-name and --cht-version flags to cht-docker-compose.sh#11098
Open
vikrantwiz02 wants to merge 3 commits into
Open
feat(#9261): add --project-name and --cht-version flags to cht-docker-compose.sh#11098vikrantwiz02 wants to merge 3 commits into
vikrantwiz02 wants to merge 3 commits into
Conversation
Contributor
Author
|
@jkuester, it's ready for review. Thanks. |
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.
Description
Closes #9261.
The
cht-docker-compose.shscript previously relied entirely on interactive prompts (read -rp,selectmenus), making it impossible to use in CI/CD pipelines or scripted workflows. This was the root cause of thestdin.write('y\n')workaround in medic/cht-conf#620, which is fragile and breaks any time a prompt is added or removed.This PR adds two optional flags to the script:
--project-name NAME-n--cht-version VERSION-VNew non-interactive usage:
All 4 existing usage patterns are fully preserved (no breaking changes):
Implementation details:
while/shiftflag loop; flags must precede any positional.envargument (conventional Unix behaviour)_) matching the existing interactive behaviour--project-nameis given and the.envalready exists, the script skips creation and starts the existing project using its existing.env, compose files, and data in$HOME/.medic/cht-docker/--help/-hmoved into the flag loop and updated to document the new flagsCode review checklist
scripts/docker-helper/tests/cht-docker-compose.spec.js);npm run unit-docker-helperruns 11 tests covering all new flags and backwards-compatible paths;npm run lintpasses clean.envfiles, compose files, and project data directories are read without modificationLicense
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.