-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refactor init cmd #432
base: main
Are you sure you want to change the base?
Refactor init cmd #432
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.
two notes:
- let's add an integration test that covers the changes here.
- make sure we are not overriding if there are existing connections with the same name.
return nil | ||
} | ||
|
||
func mergeEnvironment(centralConfig *config.Config, templateEnvName string, templateEnv config.Environment) error { |
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.
let's say the user has two envs, staging
and prod
, staging
being marked as the default
. if we have a .bruin.yml
in our template and that has an env called default
, it seems like we would create it as a new environment, correct? in that case I suggest using the user's default environment and merge into that.
Old Process:
For Every Initialized Template:
A separate .bruin.yml file was created inside the template, even if one already existed elsewhere.
New Process:
task: running bruin init with template X
if current folder is git repo:
if .bruin.yml exist in current folder:
merge .bruin.yml from current folder with the one from template X
else:
create .bruin.yml in current folder from contents of .bruin.yml of template X
create folder X in current folder with pipeline contentx except the .bruin.yml
else (current foder is not git repo):