18 lines
428 B
Python
18 lines
428 B
Python
from fabric.api import *
|
|
|
|
env.user = 'ubuntu'
|
|
|
|
env.hosts = (
|
|
'ec2-52-212-29-111.eu-west-1.compute.amazonaws.com',
|
|
)
|
|
|
|
|
|
def deploy():
|
|
local('git archive --format tar.gz -o /tmp/api.tar.gz master', capture=False)
|
|
put('/tmp/api.tar.gz', '/tmp/api.tar.gz')
|
|
with cd('/srv/api'):
|
|
run('tar xzf /tmp/api.tar.gz')
|
|
run('rm /tmp/api.tar.gz')
|
|
sudo('service api-uwsgi restart')
|
|
local('rm /tmp/api.tar.gz')
|