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

Automatically create development/creds.env if missing #216

Open
joewesch opened this issue Feb 4, 2025 · 0 comments
Open

Automatically create development/creds.env if missing #216

joewesch opened this issue Feb 4, 2025 · 0 comments
Assignees

Comments

@joewesch
Copy link

joewesch commented Feb 4, 2025

Environment

  • cookiecutter-nautobot-app version: 2.4.1

Proposed Functionality

Our instructions for new development environments built from these cookies include the following steps:

poetry shell
poetry install
cp development/creds.example.env development/creds.env
invoke build
invoke start

Copying the creds.env file feels like an arbitrary manual step in an otherwise automated process using invoke commands. Instead of requiring developers to copy the file, we should add a step to the invoke build task that checks for the existence of the file and copy the example file if it's missing.

Use Cases

  • I'm a novice developer and I want to create a development environment quickly and with the smallest amount of steps as possible.
  • I'm an advanced developer and I want to still use my own creds.env file and not have it overwritten by a blanket cp command.
  • I have a repo that uses a different filename than development/creds.env and this causes confusion when we have to explain the cp command is different than normal.
  • I have a repo where we use separate .env files for different services and would require multiple cp commands run to populate all of the necessary files.

Considerations

I brought this topic up for discussion internally before creating this issue, so I will cover some of the concerns that were brought up during that discussion.

  • We should emit a warning that we have copied the example file and it is using default credentials.
  • We must ensure that it only creates the file if there is not one existing. This functionality should not be meant to reconcile any missing values between the example file and the real file, but rather just an initial copy.
  • This should only be implemented for files in the development directory (currently only creds.env).
@joewesch joewesch self-assigned this Feb 4, 2025
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

No branches or pull requests

1 participant