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 committed Aug 11, 2023
1 parent cf9808f commit 94d0211
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE_DIR=https://github.com/ditrit/OGrEE-Core.git#feat/bff
CORE_DIR=https://github.com/ditrit/OGrEE-Core.git#{{.ImageTag}}
API_BUILD_DIR=API
APP_BUILD_DIR=APP
API_DOC_UI_PORT={{.DocPort}}
Expand Down
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 94d0211

Please sign in to comment.