Skip to content

Commit

Permalink
Added build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nfearnley committed Jun 7, 2024
1 parent bf9e0a4 commit 4460daa
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
echo ------------BEGIN-------------;
branch=$1
botname=$2
botservice=${botname}
apiservice=${botname}api
dest=~/envs/${branch}

export PIPENV_YES=1;

echo =============STOP=============;
systemctl --user stop ${apiservice};
systemctl --user stop ${botservice};

echo ============BUILD=============;
rm -rf "${dest}";
mkdir "${dest}";
cd "${dest}" &&
~/.local/bin/pipenv --rm &&
git clone --depth=1 -b ${branch} https://github.com/sizedev/SizeBot.git . &&
~/.local/bin/pipenv install . &&
~/.local/bin/pipenv run pip install cysystemd &&
~/.local/bin/pipenv run pip install uwsgi &&
systemctl --user start ${botservice} &&
systemctl --user start ${apiservice};
code=$?;\

echo ============STATUS============;
systemctl --user status ${botservice};
systemctl --user status ${apiservice};

echo =============LOG==============;
journalctl --user -u ${botservice} --since "$(systemctl show -p InactiveExitTimestamp --value --user ${botservice})";\

echo -------------END--------------;
exit $code;

0 comments on commit 4460daa

Please sign in to comment.