hs.scripts/updates/keila.sh
Milan Ihl 530f3355dc updates/keila.sh: systemd status --no-pager
Signed-off-by: Milan Ihl <milan.ihl@hostsharing.net>
2024-12-20 13:22:34 +01:00

53 lines
1.0 KiB
Bash

set -e
export XDG_RUNTIME_DIR=/run/user/$UID
export MIX_ENV=prod
basedir=$HOME/var/keila
release=`curl -Ls https://api.github.com/repos/pentacent/keila/releases/latest | jq -r '.tag_name'`
oldrelease=`$HOME/bin/keila version | cut -d " " -f2-`
tools=$basedir/.tool-versions
echo "=== Old Keila is at [ $oldrelease ], latest release is [ $release ] ==="
read -p "=> Reply yY to proceed..." -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
cd $basedir
git fetch
git checkout $release
erlang_ver=$(grep "erlang" "$tools" | awk '{print $2}')
elixir_ver=$(grep "elixir" "$tools" | awk '{print $2}')
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
asdf install erlang $erlang_ver
asdf install elixir $elixir_ver
systemctl stop --user keila
cd $basedir
mix local.hex --force
mix local.rebar --force
mix deps.get
mix deps.compile
npm ci --prefix ./assets
mix deps.clean mime --build
mix assets.deploy
mix release
systemctl start --user keila
sleep 2
systemctl status --user --no-pager keila