-
Notifications
You must be signed in to change notification settings - Fork 1
/
fabfile.py
34 lines (24 loc) · 909 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
33
34
from fabric.api import run, env, task, put, cd, local, sudo
env.use_ssh_config = True
env.hosts = ['flash_home']
@task(default=True)
def deploy():
with cd('/srv/flash-home'):
run('git pull origin master')
run('echo "COFFEE_FLASH_BASE_URL=http://flash-home.duckdns.org:3000" > env')
run('echo "PROVIDER_FLASH_BASE_URL=http://flash-home.duckdns.org:3001" >> env')
run('docker-compose --project-nam'
'e flash-home up -d --build --force-recreate')
@task
def init():
run('mkdir -p /srv/flash-home/')
with cd('/srv/flash-home'):
run('git clone --recursive https://github.com/jinnerbichler/flash-home')
@task
def logs():
with cd('/srv/flash-home'):
run('docker-compose --project-name flash-home logs -f --tail 100')
@task
def down():
with cd('/srv/flash-home'):
run('docker-compose --project-name flash-home down -v')