-
Notifications
You must be signed in to change notification settings - Fork 52
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
Integrated terraform outputs in frontend code-gen #75
Changes from 10 commits
f35c86b
8b32944
8ebec4d
1a2ba87
03db618
27e302f
46c0ac0
7f49280
550b09e
4e0f856
a9d7d51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,13 +45,6 @@ func GenerateArtifactsHelper(t *templator.Templator, cfg *config.Commit0Config, | |
kubernetes.Generate(t, cfg, &wg, pathPrefix) | ||
} | ||
|
||
// @TODO : This strucuture probably needs to be adjusted. Probably too generic. | ||
switch cfg.Frontend.Framework { | ||
case util.React: | ||
log.Println(aurora.Cyan(emoji.Sprintf("Creating React frontend"))) | ||
react.Generate(t, cfg, &wg, pathPrefix) | ||
} | ||
|
||
util.TemplateFileIfDoesNotExist(pathPrefix, "README.md", t.Readme, &wg, templator.GenericTemplateData{*cfg}) | ||
|
||
// Wait for all the templates to be generated | ||
|
@@ -63,4 +56,22 @@ func GenerateArtifactsHelper(t *templator.Templator, cfg *config.Commit0Config, | |
terraform.Execute(cfg, pathPrefix) | ||
kubernetes.Execute(cfg, pathPrefix) | ||
} | ||
|
||
if cfg.Infrastructure.AWS.Cognito.Deploy { | ||
outputs := []string{ | ||
"cognito_pool_id", | ||
"cognito_client_id", | ||
} | ||
outputValues := terraform.GetOutputs(cfg, pathPrefix, outputs) | ||
cfg.Frontend.Env.CognitoPoolID = outputValues["cognito_pool_id"] | ||
cfg.Frontend.Env.CognitoClientID = outputValues["cognito_client_id"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should write these values back to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup for sure, I think we definitely should do that |
||
} | ||
|
||
// @TODO : This strucuture probably needs to be adjusted. Probably too generic. | ||
switch cfg.Frontend.Framework { | ||
case util.React: | ||
log.Println(aurora.Cyan(emoji.Sprintf("Creating React frontend"))) | ||
react.Generate(t, cfg, &wg, pathPrefix) | ||
} | ||
|
||
} |
This file was deleted.
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 is a temporary solution. We'll need to figure out a system to the scenarios where one part of the code generation requires some output from another step.
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.
Hm yeah, that's gonna get complicated..