CloudBot icon indicating copy to clipboard operation
CloudBot copied to clipboard

Automatic Updates

Open TheFiZi opened this issue 11 years ago • 1 comments

I've got a script accomplishing this right now but it would be great if the bot could automatically 'git pull' itself on a schedule and if plugins are updated nothing happens but if core files are updated it restarts itself.

Here's what I've got for my bash script

#!/bin/bash
. ~/.bash_profile
. ~/.bashrc

cloudBotPID=`pgrep -f CloudbotRefresh`
if [ -n "$cloudBotPID" ]
then
        kill $cloudBotPID
fi

pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs pip3 install -U
pip3 install -r ~/CloudBotRefresh/requirements.txt

cd CloudBotRefresh/
git pull

tmux new -s CloudbotRefresh -d 'python3 -m cloudbot'

TheFiZi avatar Dec 31 '14 00:12 TheFiZi

I do want to improve the ways to update the bot, yeah. We used to have a plugin that handled some basic git functions but it got broken in the move to Python 3. I'll look into this soon!

On Wed, Dec 31, 2014 at 1:45 PM, Eric [email protected] wrote:

I've got a script accomplishing this right now but it would be great if the bot could automatically 'git pull' itself on a schedule and if plugins are updated nothing happens but if core files are updated it restarts itself.

Here's what I've got for my bash script

#!/bin/bash . ~/.bash_profile . ~/.bashrc

cloudBotPID=pgrep -f CloudbotRefresh if [ -n "$cloudBotPID" ] then kill $cloudBotPID fi

pip3 freeze --local | grep -v '^-e' | cut -d = -f 1 | xargs pip3 install -U pip3 install -r ~/CloudBotRefresh/requirements.txt

cd CloudBotRefresh/ git pull

tmux new -s CloudbotRefresh -d 'python3 -m cloudbot'

— Reply to this email directly or view it on GitHub https://github.com/CloudBotIRC/CloudBot/issues/52.

dmptrluke avatar Dec 31 '14 00:12 dmptrluke