@@ -45,13 +45,6 @@ func GenerateArtifactsHelper(t *templator.Templator, cfg *config.Commit0Config,
4545 kubernetes .Generate (t , cfg , & wg , pathPrefix )
4646 }
4747
48- // @TODO : This strucuture probably needs to be adjusted. Probably too generic.
49- switch cfg .Frontend .Framework {
50- case util .React :
51- log .Println (aurora .Cyan (emoji .Sprintf ("Creating React frontend" )))
52- react .Generate (t , cfg , & wg , pathPrefix )
53- }
54-
5548 util .TemplateFileIfDoesNotExist (pathPrefix , "README.md" , t .Readme , & wg , templator.GenericTemplateData {* cfg })
5649
5750 // Wait for all the templates to be generated
@@ -63,4 +56,22 @@ func GenerateArtifactsHelper(t *templator.Templator, cfg *config.Commit0Config,
6356 terraform .Execute (cfg , pathPrefix )
6457 kubernetes .Execute (cfg , pathPrefix )
6558 }
59+
60+ if cfg .Infrastructure .AWS .Cognito .Deploy {
61+ outputs := []string {
62+ "cognito_pool_id" ,
63+ "cognito_client_id" ,
64+ }
65+ outputValues := terraform .GetOutputs (cfg , pathPrefix , outputs )
66+ cfg .Frontend .Env .CognitoPoolID = outputValues ["cognito_pool_id" ]
67+ cfg .Frontend .Env .CognitoClientID = outputValues ["cognito_client_id" ]
68+ }
69+
70+ // @TODO : This strucuture probably needs to be adjusted. Probably too generic.
71+ switch cfg .Frontend .Framework {
72+ case util .React :
73+ log .Println (aurora .Cyan (emoji .Sprintf ("Creating React frontend" )))
74+ react .Generate (t , cfg , & wg , pathPrefix )
75+ }
76+
6677}
0 commit comments