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

Add deploy scripts #80

Merged
merged 2 commits into from
May 2, 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
40 changes: 40 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

REMOTE=$1
REMOTE_DIR="/home/fide"

echo "Deploy to server $REMOTE:$REMOTE_DIR"

sbt --client backend/stage

if [ $? != 0 ]; then
echo "Deploy canceled"
exit 1
fi

RSYNC_OPTIONS=" \
--archive \
--no-o --no-g \
--force \
--delete \
--progress \
--compress \
--checksum \
--verbose \
--exclude RUNNING_PID \
--exclude '.git/'"

stage="modules/backend/target/universal/stage"

include="$stage/bin $stage/lib"
rsync_command="rsync $RSYNC_OPTIONS $include $REMOTE:$REMOTE_DIR"
echo "$rsync_command"
$rsync_command
echo "rsync complete"

read -n 1 -p "Press [Enter] to continue."

echo "Restart fide"
ssh $REMOTE "chown -R fide:fide /home/fide && systemctl restart fide"

echo "Deploy complete"
2 changes: 1 addition & 1 deletion modules/backend/src/main/scala/app.config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object PostgresDriverLoader:
.or(prop("database.url"))
.as[DriverUrl]

private def host = env("POSTGRES_HOST").or(prop("postgres.host")).as[Host].default(ip"128.0.0.1")
private def host = env("POSTGRES_HOST").or(prop("postgres.host")).as[Host].default(ip"0.0.0.0")
private def port = env("POSTGRES_PORT").or(prop("postgres.port")).as[Port].default(port"5432")
private def user = env("POSTGRES_USER").or(prop("postgres.user")).as[String]
private def password = env("POSTGRES_PASSWORD").or(prop("postgres.password")).as[String]
Expand Down