Skip to content

Commit

Permalink
Updated server-index with hostname and test-mode so it picks correct …
Browse files Browse the repository at this point in the history
…documentDB password
  • Loading branch information
ToreMerkely committed Nov 7, 2024
1 parent 202c8c6 commit a08596e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
34 changes: 17 additions & 17 deletions bin/reset-or-start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@ container_name=cli_kosli_server

check_success()
{
if [ $? -eq 0 ]; then
echo -e "completed \xE2\x9C\x94"
else
echo -e "failed \xE2\x9D\x8C"
exit 52
fi
if [ $? -eq 0 ]; then
echo -e "completed \xE2\x9C\x94"
else
echo -e "failed \xE2\x9D\x8C"
exit 52
fi
}

restart_server()
{
echo restarting server ...
./bin/docker_login_aws.sh staging
echo restarting server ...
./bin/docker_login_aws.sh staging
docker compose down || true
docker pull 772819027869.dkr.ecr.eu-central-1.amazonaws.com/merkely:latest || true
docker compose up -d
./mongo/ip_wait.sh localhost:9010/minio/health/live
./mongo/ip_wait.sh localhost:8001/ready
check_success
docker pull 772819027869.dkr.ecr.eu-central-1.amazonaws.com/merkely:latest || true
docker compose up -d
./mongo/ip_wait.sh localhost:9010/minio/health/live
./mongo/ip_wait.sh localhost:8001/ready
check_success
}


if [ ! -z "$force_restart" ]; then
restart_server
restart_server
elif [ "$( docker container inspect -f '{{.State.Status}}' $container_name )" == "running" ]; then
echo reseting DB on running server ...
docker exec $container_name /app/test/clean_database.py
check_success
docker exec $container_name /app/test/clean_database.py
check_success
else
restart_server
restart_server
fi

echo creating test users on server ...
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ services:
container_name: cli_kosli_server-index
read_only: true
env_file: [ "./mongo/mongo.env" ]
environment:
KOSLI_HOSTNAME: localhost
TEST_MODE: cli
stop_signal: SIGINT
tmpfs:
- /tmp
Expand Down

0 comments on commit a08596e

Please sign in to comment.