Skip to content

Commit

Permalink
Fix superadmin deploy without Arango
Browse files Browse the repository at this point in the history
  • Loading branch information
helderbetiol authored and vbeaucha committed Aug 17, 2023
1 parent 1554356 commit ef5c2be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions APP/ogree_app_backend/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,28 @@ func dockerCreateTenant(newTenant tenant) string {
args = append(args, "doc")
}

// Default values, empty vars not accepted on docker compose
newTenant.BffApiListFile = "./bff_api_list.json"
newTenant.BffPort = newTenant.ApiPort
if newTenant.HasBff {
args = append(args, "--profile")
args = append(args, "arango")
if newTenant.BffPort == "" {
// Set BFF and API ports
newTenant.BffPort = newTenant.ApiPort
// Set API Port to BFF Port + 1
port, _ := strconv.Atoi(newTenant.ApiPort)
newTenant.ApiPort = strconv.Itoa(port + 1)
}
// Create bff api list json file
file, _ := os.Create(appDeployDir + tenantLower + "-bff-api-list.json")
err := bfftmplt.Execute(file, newTenant)
if err != nil {
fmt.Println("Error creating bff api list file: " + err.Error())
newTenant.BffApiListFile = "./bff_api_list.json"
} else {
newTenant.BffApiListFile = "./app-deploy/" + tenantLower + "/" + tenantLower + "-bff-api-list.json"
}
file.Close()
}

args = append(args, "up")
args = append(args, "--build")
args = append(args, "-d")
Expand Down

0 comments on commit ef5c2be

Please sign in to comment.