M .gitignore => .gitignore +1 -0
@@ 34,3 34,4 @@ npm-debug.log
/.envrc
/tmp/
+harvey.tar.gz
M fabfile.py => fabfile.py +15 -4
@@ 1,6 1,7 @@
from datetime import date
from fabric import task
from invoke import run
+from os.path import exists
@task()
@@ 8,14 9,24 @@ def deploy(c):
# Fail early if sudo password is not valid
c.sudo("echo")
+ if exists("harvey.tar.gz"):
+ print("Deploying release: harvey.tar.gz")
+ else:
+ print("harvey.tar.gz not found, aborting")
+ return
+
+ print("Copying release...")
+ run("scp harvey.tar.gz bezdomni:projects/harvey/")
+
print("\nStopping harvey service...")
c.sudo("service harvey stop")
- print("\nSyncing release files...")
- run("rsync --archive --compress --delete --links --stats _build/prod bezdomni:projects/harvey")
-
- print("\nRunning migrations...")
with c.cd("projects/harvey"):
+ print("\nExtracting release...")
+ c.run("rm -rf prod")
+ c.run("tar xzf harvey.tar.gz")
+
+ print("\nRunning migrations...")
c.run("source .envrc && ./prod/rel/harvey/bin/migrate")
print("\nStarting harvey service...")