@@ -15,6 +15,12 @@ type ConfigureCmd struct {
1515
1616type configGenFunc func (cfg EnvironmentConfig , path string ) error
1717
18+ type CloudserverTemplateData struct {
19+ EnvironmentConfig
20+ Port int
21+ MetricsPort int
22+ }
23+
1824func (c * ConfigureCmd ) Run () error {
1925 rc := RuntimeConfigFromFlags (c .EnvDir , c .Name )
2026 envPath := filepath .Join (rc .EnvDir , rc .EnvName )
@@ -107,16 +113,42 @@ func generateCloudserverConfig(cfg EnvironmentConfig, path string) error {
107113 }
108114 }
109115
116+ // Render the main config.json with port 8000
117+ templateData := CloudserverTemplateData {
118+ EnvironmentConfig : cfg ,
119+ Port : 8000 ,
120+ MetricsPort : 8002 ,
121+ }
122+
110123 err := renderTemplateToFile (
111124 getTemplates (),
112125 configTemplate ,
113- cfg ,
126+ templateData ,
114127 filepath .Join (path , "cloudserver" , "config.json" ),
115128 )
116129 if err != nil {
117130 return err
118131 }
119132
133+ // Render config-destination.json with port 8001 if CRR is enabled
134+ if cfg .Features .CrossRegionReplication .Enabled {
135+ destTemplateData := CloudserverTemplateData {
136+ EnvironmentConfig : cfg ,
137+ Port : 8001 ,
138+ MetricsPort : 8003 ,
139+ }
140+
141+ err = renderTemplateToFile (
142+ getTemplates (),
143+ configTemplate ,
144+ destTemplateData ,
145+ filepath .Join (path , "cloudserver" , "config-destination.json" ),
146+ )
147+ if err != nil {
148+ return err
149+ }
150+ }
151+
120152 return renderTemplateToFile (
121153 getTemplates (),
122154 "templates/cloudserver/locationConfig.json" ,
@@ -132,6 +164,8 @@ func generateBackbeatConfig(cfg EnvironmentConfig, path string) error {
132164 "config.json" ,
133165 "config.notification.json" ,
134166 "notificationCredentials.json" ,
167+ "create-service-user.sh" ,
168+ "Dockerfile.setup" ,
135169 }
136170
137171 return renderTemplates (cfg , "templates/backbeat" , filepath .Join (path , "backbeat" ), templates )
0 commit comments