Skip to content

Instantly share code, notes, and snippets.

@chx
Created October 29, 2012 23:35
Show Gist options
  • Save chx/3977347 to your computer and use it in GitHub Desktop.
Save chx/3977347 to your computer and use it in GitHub Desktop.
rtorrent setup on slave
system.method.set_key = event.download.finished,done,"execute=/usr/local/bin/run.sh,$d.get_name=;d.set_directory=/var/www"
schedule = watch_directory,1,1,load_start=/root/torrent/watch/*.torrent
root@test3:~# cat /usr/local/bin/run.sh
#!/bin/sh
logger run.sh started with $1
mv /root/torrent/$1 /var/www
test.sh $1 2>&1 > /dev/null &
root@test3:~# cat /usr/local/bin/test.sh
#!/bin/sh
own=`hostname -i|sed 's/ /\n/g'|grep -F '10.'`
killall -9 mysqld
rm -r /dev/shm/mysql
mkdir /dev/shm/mysql
chown mysql:mysql /dev/shm/mysql
mysql_install_db
service mysql start
logger mysql started
mysql -u root -e 'create database drupal'
cd /var/www/$1
drush si -y standard --db-url='mysql://root@localhost/drupal'
drush ev 'module_enable(array("simpletest"));'
chown -R www-data:www-data sites/default/files/
grep -v install_profile sites/default/settings.php > /tmp/x
mv /tmp/x sites/default/settings.php
while read -r test
do
logger testing "$test"
sudo -u www-data php core/scripts/run-tests.sh --url http://localhost/$1 --class "$test" 2>&1 >> result.txt
done < "tests/$own"
scp result.txt `cat /etc/ssh/master/ip`:results/$1
@chx
Copy link
Author

chx commented Nov 2, 2012

Don't forget aptitude install screen rtorrent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment