Skip to content

Commit

Permalink
worked on deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jinnerbichler committed Jan 26, 2018
1 parent 97071d9 commit 040a585
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ services:
image: homeassistant/home-assistant:0.61.1
environment:
- "TZ=Europe/Berlin"
- "COFFEE_FLASH_BASE_URL=http://localhost:4444"
- "COFFEE_FLASH_BASE_URL=http://flash-home.duckdns.org:3000/"
- "PROVIDER_FLASH_BASE_URL=http://flash-home.duckdns.org:3001/"
ports:
- 80:8123 # Home Assistant
- 1883:1883 # MQTT
Expand Down
29 changes: 29 additions & 0 deletions fabfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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-name flash-home pull')
run('docker-compose --project-name 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')

0 comments on commit 040a585

Please sign in to comment.