build: fix environment variables in startup script
This commit is contained in:
1 parent
53c3ddb732
commit
dc4ea8c661
2 files changed
+11
-11
No files matched your search
+5
-5
@@ -3,9 +3,9 @@
|
|||||||
git fetch || exit 1
|
git fetch || exit 1
|
||||||
git pull || exit 1
|
git pull || exit 1
|
||||||
|
|
||||||
sudo docker compose down || exit 1
|
docker compose down || exit 1
|
||||||
sudo docker compose pull || exit 1
|
docker compose pull || exit 1
|
||||||
sudo docker compose build || exit 1
|
docker compose build || exit 1
|
||||||
|
|
||||||
sudo docker compose up -d
|
docker compose up -d
|
||||||
sudo docker compose logs -f
|
docker compose logs -f
|
||||||
+6
-6
@@ -24,23 +24,23 @@ if [ ! -f /usr/bin/nc ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$API_PORT" ]; then
|
if [ -z $API_PORT ]; then
|
||||||
API_PORT=9000;
|
API_PORT=9000;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$MYSQL_HOST" ]; then
|
if [ -z $MYSQL_HOST ]; then
|
||||||
MYSQL_HOST="$(prop 'MYSQL_HOST')"
|
MYSQL_HOST="localhost"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$MYSQL_PORT" ]; then
|
if [ -z $MYSQL_PORT ]; then
|
||||||
MYSQL_PORT=$(prop 'MYSQL_PORT')
|
MYSQL_PORT=3306
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting 10 seconds for database to start.."
|
echo "Waiting 10 seconds for database to start.."
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
echo "Checking if MySQL / MariaDB is started.."
|
echo "Checking if MySQL / MariaDB is started.."
|
||||||
if /usr/bin/nc -z "$MYSQL_HOST" "$MYSQL_PORT"; then
|
if /usr/bin/nc -z $MYSQL_HOST $MYSQL_PORT; then
|
||||||
echo "Database OK. Starting bot..";
|
echo "Database OK. Starting bot..";
|
||||||
/opt/java/openjdk/bin/java -jar /app/netneutrality-jar-with-dependencies.jar &
|
/opt/java/openjdk/bin/java -jar /app/netneutrality-jar-with-dependencies.jar &
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user