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

Update run_local.sh to create .env files for each microservice #42

Open
jashmehta3300 opened this issue Oct 25, 2023 · 5 comments
Open
Assignees
Labels
bash enhancement New feature or request good first issue Good for newcomers

Comments

@jashmehta3300
Copy link
Contributor

Problem Statement

Currently the run_loca.sh script (https://github.com/cisco-open/martian-bank-demo/blob/main/scripts/run_local.sh) does not create .env files, and they have to be created manually.

Proposed Solution

Create these files automatically during installation.

@jashmehta3300 jashmehta3300 added enhancement New feature or request good first issue Good for newcomers bash labels Oct 25, 2023
@SaiNikhil02
Copy link

@jashmehta3300 can you please assign me this issue

@DevanshAshar
Copy link

Hi @jashmehta3300 ,
Devansh here from DJ Unicode, could you pls assign the issue to me

@DevanshAshar
Copy link

Thank you @jashmehta3300 for assigning the issue to me
Just wanted to clarify can we assume that the folders which require .env files will have .env.example prebuilt in it
Since if .env needs to be built automatically on installation then the required env variables for respective folders must be known beforehand
So can we proceed with a solution shown below
.env.example → assuming each microservice will have an .env.example file with the variables defined that are required to run it.
image

Terminal → asking the user to provide values for the environment variables
image

.env → autocreated like this by extracting variables from .env.example
image

Could you please clarify if this is the right approach or something else is expected.

@jashmehta3300
Copy link
Contributor Author

Hi @DevanshAshar. Thanks for the suggestion, I think this is the right approach.

However, the microservices do not have .env.example files with the variable names currently. It would be great if you could also add those files in the respective folders.

Lastly, for the second step (i.e. taking env values for the terminal), I think it would be better if we only ask for DB_URL and keep the other variables optional since they already have default values in the code.

@jashmehta3300 jashmehta3300 mentioned this issue Jan 18, 2024
13 tasks
DevanshAshar added a commit to DevanshAshar/martian-bank-demo that referenced this issue Jan 19, 2024
also added env example files in respective folders
co-authored-by: Dhruv <[email protected]>
co-authored-by: Tanish <[email protected]>
co-authored-by: Vidhita <[email protected]>
@DevanshAshar
Copy link

Hey @jashmehta3300 have added .env.example files in respective folders and also have added code to auto-create .env with start cmd .
Could you please review the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants