-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Frontend -- Remove logo - Backend -- Bugfix to resolve dict_items for texts with labels - Update run.sh to provide options for re-deployment - update docker-compose
- Loading branch information
Showing
10 changed files
with
387 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,78 @@ | ||
#!/bin/bash -e | ||
|
||
#clean up possible old containers | ||
docker compose --profile client down | ||
deploy_all=false | ||
deploy_backend=false | ||
deploy_frontend=false | ||
deploy_database=false | ||
|
||
BASE_PATH=$(pwd) | ||
FRONTEND_PATH="$BASE_PATH/frontend" | ||
print_usage() { | ||
echo "Usage: $0 [-a] [-b] [-d] [-f] [-h]" >&2; | ||
echo "options: | ||
-a Deploy all containers | ||
-b Deploy backend container | ||
-d Deploy database container | ||
-f Build and Deploy frontend container | ||
-h this help message" | ||
exit 1; | ||
} | ||
|
||
# create vue-builder image | ||
cd $FRONTEND_PATH | ||
docker build --network host -t vue-builder -f Dockerfile.build . | ||
while getopts ":abdfh" OPTION; do | ||
case "$OPTION" in | ||
a) deploy_all=true;; | ||
b) deploy_backend=true;; | ||
d) deploy_database=true;; | ||
f) deploy_frontend=true;; | ||
h) print_usage;; | ||
\?) echo "$0: Error: Invalid option: -${OPTARG}" >&2; exit 1;; | ||
:) echo "$0: Error: option -${OPTARG} requires an argument" >&2; exit 1;; | ||
esac | ||
done | ||
shift "$(($OPTIND -1))" | ||
|
||
# run vue-builder image to create dist | ||
docker run --rm -v $FRONTEND_PATH/dist:/root/dist vue-builder | ||
echo "all: $deploy_all" | ||
echo "backend: $deploy_backend" | ||
echo "database: $deploy_database" | ||
echo "frontend: $deploy_frontend" | ||
|
||
if $deploy_all; then | ||
echo "Re-deploy all containers" | ||
|
||
#clean up possible old containers | ||
docker compose --profile client down | ||
|
||
BASE_PATH=$(pwd) | ||
FRONTEND_PATH="$BASE_PATH/frontend" | ||
|
||
# create vue-builder image | ||
cd $FRONTEND_PATH | ||
docker build --network host -t vue-builder -f Dockerfile.build . | ||
|
||
# run vue-builder image to create dist | ||
docker run --rm -v $FRONTEND_PATH/dist:/root/dist vue-builder | ||
|
||
export BACKEND_TAG=$(cat $BASE_PATH/SWEGRAM_BACKEND) | ||
# Start the containers with help of docker compose | ||
# remove data (mysql container generates data folder) | ||
docker compose --profile client up -d --build | ||
|
||
else | ||
if $deploy_backend; then | ||
docker compose --profile backend down || true | ||
export BACKEND_TAG=$(cat $(pwd)/SWEGRAM_BACKEND) | ||
backend_image="rex0046/swegram-backend:$BACKEND_TAG" | ||
echo "backend image: $backend_image" | ||
# docker pull $backend_image | ||
docker compose --profile backend up -d | ||
fi | ||
|
||
if $deploy_frontend; then | ||
docker compose --profile frontend down || true | ||
docker compose --profile frontned up -d --build | ||
fi | ||
|
||
if $deploy_database; then | ||
docker compose --profile database down || true | ||
docker compose --profile database up -d | ||
fi | ||
fi | ||
|
||
# Start the containers with help of docker compose | ||
# remove data (mysql container generates data folder) | ||
docker compose --profile client up -d --build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.