-
Notifications
You must be signed in to change notification settings - Fork 21
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
Simplify the setup script, capture only what is absolutely needed #576 #591
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration from current setup needs to be handled:
- Check if there are
.env
files in the package directories - If there are, merge those with the main
.env
, then delete them - Then load main
.env
- Start setup
packages/setup/src/index.ts
Outdated
); | ||
|
||
const apiEnv = { | ||
MONGO_INITDB_ROOT_USERNAME: randomString(12), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't generate random usernames for root username and username. Use the ones specified in .env.template
packages/setup/src/index.ts
Outdated
|
||
const apiEnv = { | ||
MONGO_INITDB_ROOT_USERNAME: randomString(12), | ||
MONGO_INITDB_ROOT_PASSWORD: randomString(12), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passwords should not be regenerated on each run
packages/setup/src/index.ts
Outdated
}); | ||
dotenv.config({ path: '/usr/praise/packages/frontend/.env', override: true }); | ||
dotenv.config({ path: '/usr/praise/.env.template', override: false }); | ||
dotenv.config({ path: '/usr/praise/.env', override: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Override should be true
, right? The template should override any pre-existing env settings. And the "real" .env
should override the template.
@@ -133,18 +125,30 @@ const questions = [ | |||
}, | |||
]; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this because i wanted to use process env variable if exists. If not than we can build url depending on node env
And also i moved this to separate method because of SonarCloud was reporting code smell if we have nested conditionals
Co-authored-by: Kristofer <[email protected]>
…ack/praise into simplify_setup_script
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Resolves #576