#!/bin/sh


# clear ssr cache
set -o allexport
SCRIPTDIR=$(dirname "$0")
source $SCRIPTDIR/../.env
set +o allexport

ssrUrl="https://${PROJECT_NAME}-tibiserver.code.testversion.online/api/v1/_/${TIBI_NAMESPACE}/ssr"
curl --silent -X POST -H "Content-Type: application/json" -d '{}' "${ssrUrl}?clear=1"

sleep 1


# restart tibiserver and tibiserver-dev (if exists)
docker compose -f docker-compose-local.yml restart tibiserver 2>&1
docker compose -f docker-compose-local.yml restart tibiserver-dev 2>&1


exit 0
