badgey/cicd/deploy.sh

12 lines
368 B
Bash
Executable File

#!/bin/bash
bot=$(echo "$1" | tr '[:upper:]' '[:lower:]')
echo "Running deploy for bot ${bot}"
ssh badgey@$bot sudo /usr/bin/systemctl stop $bot
rsync -avP badgey badgey@$bot:/srv/$bot/$bot
rsync -avP config badgey@$bot:/srv/$bot/
rsync -avP txt badgey@$bot:/srv/$bot/
ssh badgey@$bot sudo chmod a+x /srv/$bot/$bot
ssh badgey@$bot sudo /usr/bin/systemctl start $bot