Skip to content

Commit

Permalink
Fix APP bugs: launch.sh on Mac and tenant docker status (#334)
Browse files Browse the repository at this point in the history
* fix(deploy) app launch for mac

* fix(deploy) default por for back

* fix(app) docker status for tenant
  • Loading branch information
helderbetiol authored Dec 19, 2023
1 parent e094f83 commit 0d4f7a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion APP/lib/common/api_backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ Future<Result<List<DockerContainer>, Exception>> fetchTenantDockerInfo(
print("API get Tenant Docker Info");
client ??= http.Client();
try {
Uri url = Uri.parse('$apiUrl/api/tenants/${tenantName.toLowerCase()}');
Uri url = Uri.parse('$apiUrl/api/tenants/${tenantName}');
final response = await client.get(url, headers: getHeader(token));
print(response.statusCode);
if (response.statusCode == 200) {
Expand Down
13 changes: 10 additions & 3 deletions deploy/app/launch.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash

portWeb=8080
portBack=8082
portBack=8081
forceStop=false
while getopts w:b:f flag
isMac=false
while getopts w:b:fm flag
do
case "$flag" in
w) portWeb=${OPTARG};;
b) portBack=${OPTARG};;
f) forceStop=true;;
m) isMac=true;;
esac
done

Expand Down Expand Up @@ -39,5 +41,10 @@ docker run --restart always --name $containername -p $portWeb:80 -v $assetsDir:/

# compile and run back
cd ../BACK/docker-backend
docker run --rm -v $(pwd):/workdir -w /workdir golang go build -o ogree_app_backend
if $isMac; then
echo "Compiling backend for macOS"
docker run --rm -v $(pwd):/workdir -w /workdir -e GOOS=darwin golang go build -o ogree_app_backend
else
docker run --rm -v $(pwd):/workdir -w /workdir -e GOOS=linux golang go build -o ogree_app_backend
fi
./ogree_app_backend -port $portBack

0 comments on commit 0d4f7a8

Please sign in to comment.