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
[apply] execute make in each project #145
Conversation
e683ff4
to
1ae62bc
Compare
423ea69
to
4d64652
Compare
541970b
to
5428e94
Compare
Infrastructure Infrastructure // TODO simplify and flatten / rename? | ||
Context map[string]string | ||
Modules []string | ||
Name string `yaml:"name"` |
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.
This will likely cause conflicts with @dtoki 's stuff but we can figure it out.
@@ -0,0 +1,43 @@ | |||
package projectconfig |
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 don't think this is the right place for this. Maybe move to an internal/apply
package?
internal/context/apply.go
Outdated
@@ -0,0 +1,65 @@ | |||
package context |
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.
Move to an internal/apply
package?
internal/context/apply.go
Outdated
fmt.Println(`Choose the environments to apply. This will create infrastructure, CI pipelines, etc. | ||
At this point, real things will be generated that may cost money! | ||
Only a single environment may be suitable for an initial test, but for a real system we suggest setting up both staging and production environments.`) | ||
applyEnvironments = promptEnvironments() |
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.
This won't affect the value of applyEnvironments
in the calling code, but it might be better to merge this and the stuff in the other file into the same package anyway.
internal/context/init.go
Outdated
@@ -63,11 +63,11 @@ func Init(projectName string, outDir string) *projectconfig.ZeroProjectConfig { | |||
} | |||
|
|||
// loadAllModules takes a list of module sources, downloads those modules, and parses their config | |||
func loadAllModules(moduleSources []string) map[string]moduleconfig.ModuleConfig { | |||
func loadAllModules(moduleSources projectconfig.Modules) map[string]moduleconfig.ModuleConfig { |
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.
This shouldn't accept projectconfig.Modules, just a slice of string. At this point there is no project config and all we have are some repo paths.
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.
changed it back to a []string
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.
Thanks, could you remove the changes to the registry section as well?
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.
done!
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.
Some changes requested
|
||
// AppendProjectEnvToCmdEnv will add all the keys and values from envMap | ||
// into envList as key-value pair strings (e.g.: "key=value") | ||
func AppendProjectEnvToCmdEnv(envMap map[string]string, envList []string) []string { |
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.
This will conflict with a change in David's PR since he also moved this function. But I agree it should be here in util.
986cbae
to
b7e908d
Compare
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.
Nice! Thanks!
Runs `make` on every created project folder [related to #132]
the reason is because yaml does not support tabs
ddbb4e7
to
fc0217e
Compare
fc0217e
to
2e2718a
Compare
2e2718a
to
51b52d5
Compare
Apply Command [closes #132]
This MR will add the
zero apply
basic functionality.zero apply
loads thezero-project.yaml
config file and executesmake
on each module folder of a specific project, passing environment variables as received by the command.The
zero-project.yaml
file was changed to reflect the spec (link). Notice the change to themodules
attribute from a list to just a single map of modulues. See example below:The struct
projectconfig.ZeroProjectConfig
that holds the unmarshalled config information was also changed to reflect that.Some changes to the
zero init
function were also needed, like marshalling the config context that the user fills in during the execution ofinit
and saving thezero-project.yaml
file, and everything related to the struct.