Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1fe413fef4
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (38 sloc) 1.095 kb
from fabric.api import *
config.project_name = 'johancc'
def git_pull():
"Updates the repository"
run("cd ~git/$(repo)/; git pull $(parent) $(branch)")
def git_reset():
"Resets the repository to specified version."
run("cd ~/git/$(repo)/; git reset --hard $(hash)")
def test():
local("python manage.py test", fail="abort")
#def syncdb
# migrate
# pip install -r requirements.txt
#
def production():
config.fab_hosts = ['tango.johan.cc']
config.repos = REPOS
def reboot():
"Reboot Apache2 server."
sudo('/etc/init.d/apache2 restart')
def pull():
require('fab_hosts', provided_by=[production])
invoke(test)
for repo, parent, branch in config.repos:
config.repo = repo
config.parent = parent
config.branch = branch
invoke(git_pull)
def reset(repo, hash):
"""
Reset all git repositories to specified hash.
Usage:
fab reset:repo=my_repo,hash=etcetc123
"""
require("fab_hosts", provided_by=[staging, production])
config.hash = hash
config.repo = repo
invoke(git_reset)
Jump to Line
Something went wrong with that request. Please try again.