Skip to content
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

Cruft deployment with no user prompts #720

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

etrapnell-nist
Copy link
Collaborator

Tests for bypassing cruft prompts as specified in #680. The "Running Dioptra" doc has been updated to include the prompt-less cruft invocation.

@keithmanville
Copy link
Collaborator

Is it possible to provide a (partial) configuration via list of parameters as part of the cruft create command or as a parameter that points to a config file? Or is the only option to skip the prompts and use the defaults from the repository?

For example, cruft update command has a --variables-to-update argument which takes a JSON string of parameters to set:

cruft update --checkout dev --variables-to-update '{ "docker_compose_path": "docker compose" }'

@keithmanville keithmanville self-requested a review January 29, 2025 18:33
@keithmanville
Copy link
Collaborator

I tested the promptless deployment as instructed in the new docs, and it worked as expected. I also pulled the branch and verified the new tests pass.

@keithmanville
Copy link
Collaborator

The failing mypy tests should be resolved after rebasing on dev.

@etrapnell-nist
Copy link
Collaborator Author

Is it possible to provide a (partial) configuration via list of parameters as part of the cruft create command or as a parameter that points to a config file? Or is the only option to skip the prompts and use the defaults from the repository?

For example, cruft update command has a --variables-to-update argument which takes a JSON string of parameters to set:

cruft update --checkout dev --variables-to-update '{ "docker_compose_path": "docker compose" }'

Yes it is possible to skip the prompts while overriding the defaults. Use cruft create with these options as an example: --no-input --extra-context '{"nginx_server_name": "dioptra2.example.com"}'

@keithmanville
Copy link
Collaborator

Nice! I confirmed that works. Can we add it to the documentation?

Can we also suggest the user may want to put their deployment config in a file and provide it like this:

cruft create https://github.com/usnistgov/dioptra --checkout dev \
  --directory cookiecutter-templates/cookiecutter-dioptra-deployment --no-input --extra-context "`cat deployment-config.json`"

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

Successfully merging this pull request may close these issues.

Figure out how to create a dioptra deployment with cruft with no user prompts
2 participants