cisco-open / martian-bank-demo

MartianBank is a microservices demo application that allows customers to access and manage their bank accounts, perform financial transactions, locate ATMs, and apply for loans.
BSD 3-Clause "New" or "Revised" License
23 stars 39 forks source link

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

Open jashmehta3300 opened 1 year ago

jashmehta3300 commented 1 year ago

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.

SaiNikhil02 commented 1 year ago

@jashmehta3300 can you please assign me this issue

DevanshAshar commented 11 months ago

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

DevanshAshar commented 11 months ago

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 commented 11 months ago

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.

DevanshAshar commented 9 months ago

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