2019-01-10 13:03:52 -05:00
|
|
|
#!/bin/ash
|
|
|
|
# shellcheck shell=dash
|
2018-08-20 17:06:34 -04:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-01-10 13:03:52 -05:00
|
|
|
if [ -n "$BUILDTIME" ]; then
|
2019-01-10 13:49:47 -05:00
|
|
|
echo "#> Preparing compilation..."
|
|
|
|
|
2019-01-09 15:23:53 -05:00
|
|
|
mix local.rebar --force
|
|
|
|
mix local.hex --force
|
2018-12-24 17:20:17 -05:00
|
|
|
|
2019-01-10 13:49:47 -05:00
|
|
|
echo "#> Compiling..."
|
2018-12-24 17:20:17 -05:00
|
|
|
mix deps.get
|
|
|
|
mix compile
|
2018-12-30 08:30:36 -05:00
|
|
|
exit 0
|
2018-12-24 17:20:17 -05:00
|
|
|
fi
|
|
|
|
|
2019-01-10 13:49:47 -05:00
|
|
|
echo "#> Applying customizations and patches.."
|
|
|
|
rsync -av /custom.d/ /home/pleroma/pleroma/
|
|
|
|
|
|
|
|
echo "#> Recompiling..."
|
|
|
|
mix compile
|
|
|
|
|
|
|
|
echo "#> Waiting until database is ready..."
|
2019-01-10 13:32:40 -05:00
|
|
|
while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do
|
|
|
|
sleep 1s
|
|
|
|
done
|
2018-12-30 08:30:36 -05:00
|
|
|
|
2019-01-10 13:49:47 -05:00
|
|
|
echo "#> Upgrading database..."
|
2018-08-20 17:06:34 -04:00
|
|
|
mix ecto.migrate
|
2018-12-24 17:20:17 -05:00
|
|
|
|
2019-01-10 13:49:47 -05:00
|
|
|
echo "#> Liftoff!"
|
2018-08-20 17:06:34 -04:00
|
|
|
exec mix phx.server
|