Skip to content

Commit

Permalink
Clean "deploy" target
Browse files Browse the repository at this point in the history
  • Loading branch information
naspeh committed Oct 16, 2018
1 parent 244376a commit a4b0fb2
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ def sh(cmd):
return 0


def ssh(cmd):
return sh(
'ssh yadro.org -p2200 "%s"'
% cmd.replace('"', '\\"').replace('$', '\\$')
)


def reqs(dev, clear, wheels):
requirements = (
Expand Down Expand Up @@ -64,26 +58,6 @@ def process_args():
.format('root@h1.pusto.org')
))

cmd('deploy', help='deploy to server')\
.arg('-c', '--clear', action='store_true', help='clear virtualenv')\
.arg('-t', '--target', default='origin/master', help='checkout it')\
.exe(lambda a: ssh(
'cd /home/pusto/src'
'&& git fetch origin' +
'&& git checkout {}'.format(a.target) +
(
'&& rm -rf $(cat .venv) && virtualenv $(cat .venv)'
if a.clear else ''
) +
'&& source $(cat .venv)/bin/activate' +
'&& ./bootstrap'
'&& ./pusto.py build -b build-tmp'
'&& rm -rf build'
'&& mv build-tmp build'
'&& rsync -av ./deploy/nginx.conf /etc/nginx/site-pusto.conf'
'&& supervisorctl pid nginx | xargs kill -s HUP'
))

cmd('reqs', help='update python requirements')\
.arg('-d', '--dev', action='store_true')\
.arg('-c', '--clear', action='store_true')\
Expand Down

0 comments on commit a4b0fb2

Please sign in to comment.