Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 30 lines (20 sloc) 638 Bytes
from fabric import task, Connection
import os
HOST_NAME = os.environ.get("HOST_NAME", "pi@pi-frodo")
@task
def copy(c):
raspis = HOST_NAME.split(' ')
for r in raspis:
print(r)
remove_dists(c, r)
make_new_dist(c, r)
install_new_dist(r)
c.run('echo Done.')
def remove_dists(c, r):
Connection(r).run('rm -rf ~/dist')
c.run('rm -rf dist/ *.egg-info/')
def make_new_dist(c, r):
c.run('python setup.py sdist')
c.run('scp -r dist/ {}:/home/pi'.format(r))
def install_new_dist(r):
Connection(r).run('/home/pi/.virtualenvs/screenly/bin/pip install -U ~/dist/*.tar.gz')