forked from ianmcorvidae/mb2freedb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
22 lines (19 loc) · 816 Bytes
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from fabric.api import *
from time import sleep
from fabric.colors import red
env.use_ssh_config = True
env.sudo_prefix = "sudo -S -p '%(sudo_prompt)s' -H " % env
def production():
env.host_string = "freedb.musicbrainz.org"
no_local_changes()
with cd("/home/mb2freedb/mb2freedb"):
sudo("git remote set-url origin git://github.com/ianmcorvidae/mb2freedb.git", user="mb2freedb")
sudo("git pull --ff-only", user="mb2freedb")
sudo("python2 setup.py install")
sudo("invoke-rc.d apache2 restart")
def no_local_changes():
# The exit code of these will be 0 if there are no changes.
# If there are changes, then the author should fix his damn code.
with settings(hide("stdout")):
local("git diff --exit-code")
local("git diff --exit-code --cached")