You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
misskey-ebooks-bot/deploy.sh

30 lines
880 B

#!/bin/sh
USER=$1 # your ssh user
HOST=$2 # your server host
DIR=$3 # the directory where the bot files will go name it as you wish
BOT=$4 # the bot name
echo "Target directory: ${DIR}"
sleep 1
rm -rf ./"${DIR}"
# Copy and move the files to a directory
echo "Copying files..."
mkdir "${DIR}"
#cp -r venv/ ./"${DIR}"
#cp markov.json roboduck.db roboduck.py update.py rdbot.py bot.cfg requirements.txt run.sh ./"${DIR}"
cp roboduck.py update.py rdbot.py requirements.txt run.sh bot-"${BOT}".cfg ./"${DIR}"
mv ./"${DIR}"/bot-"${BOT}".cfg ./"${DIR}"/bot.cfg
# Uncomment this to run tests
# rsync -avz --dry-run live/ ${USER}@${HOST}:~/${DIR}
# Comment this one when running tests - this will delete everything on the server that's not in the local public folder
rsync -avz "${DIR}"/ "${USER}"@"${HOST}":~/"${DIR}"
echo "Deleting directory: ${DIR}..."
rm -rf ./"${DIR}"
exit 0