-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
32 lines (26 loc) · 970 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
23
24
25
26
27
28
29
30
31
32
from fabric.api import *
import requests
project = "kenmare"
repository = "git@github.com:Bowery/" + project + ".git"
hosts = [
'ubuntu@ec2-54-166-150-115.compute-1.amazonaws.com',
'ubuntu@ec2-54-162-40-78.compute-1.amazonaws.com'
]
env.key_filename = '/home/ubuntu/.ssh/id_aws'
env.password = 'java$cript'
@parallel
def restart():
sudo('mkdir -p /home/ubuntu/gocode/src/github.com/Bowery/')
with cd('/home/ubuntu/gocode/src/github.com/Bowery/gopackages'):
run('git pull')
with cd('/home/ubuntu/gocode/src/github.com/Bowery/delancey'):
run('git pull')
with cd('/home/ubuntu/gocode/src/github.com/Bowery/' + project):
run('git pull')
sudo('GOPATH=/home/ubuntu/gocode go get -d')
sudo('GOPATH=/home/ubuntu/gocode go build -o kenmare-server')
sudo('cp -f ' + project + '.conf /etc/init/' + project + '.conf')
sudo('initctl reload-configuration')
sudo('restart ' + project)
def deploy():
execute(restart, hosts=hosts)