Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Fabfile to:
- # - update the remote system(s)
- # - download and install an application
- # Import Fabric's API module
- import os
- from fabric.api import *
- env.hosts = [
- 'ec2-54-93-42-94.eu-central-1.compute.amazonaws.com',
- # 'ip.add.rr.ess
- # 'server2.domain.tld',
- ]
- # Set the username
- env.user = "ubuntu"
- env.key_filename = ["mikaelubuntu.pem",]
- # Set the password [NOT RECOMMENDED]
- # env.password = "passwd"
- def setup():
- """
- Update the default OS installation's
- basic default tools.
- """
- run("cd ~/")
- sudo("apt-get update")
- sudo("apt-get install -y git")
- run("rm -r -f rworker")
- run("git clone -b fortesting https://github.com/DurandA/rworker.git")
- run("cd rworker")
- def run_rworker():
- with cd('/home/ubuntu/rworker'):
- run("java -Djava.library.path=dist -jar drttor.jar -o testing zero_1M_64.worker")
- def kill_rworker():
- run("pkill -f 'java -jar'")
- def send_torrent(torrent_path):
- put(torrent_path, "/home/ubuntu/rworker/%s" % os.path.basename(torrent_path))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement