Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated server-index with hostname and test-mode so it picks correct documentDB password #373

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.slack_webhook }}

snyk-code:
if: false # Have reached limit of 200 tests this month
name: Snyk Code
runs-on: ubuntu-latest
permissions:
Expand Down
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
Loading