~ihabunek/triglav

ref: 7bd0f8dc1b9e142efe146effd96f2200c8a6ef56 triglav/fabfile.py -rw-r--r-- 589 bytes
7bd0f8dcIvan Habunek Update/fix prerequisites 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from fabric import task
from invoke import run


@task()
def deploy(c):
    # Fail early if sudo password is not valid
    c.sudo("echo")

    print("\nStopping triglav service...")
    c.sudo("service triglav stop")

    print("\nSyncing release files...")
    run("rsync --archive --compress --delete --links --stats _build/prod bezdomni:projects/triglav")

    print("\nRunning migrations...")
    with c.cd("projects/triglav"):
        c.run('source .envrc && ./triglav eval "Triglav.Release.migrate()"')

    print("\nStarting triglav service...")
    c.sudo("service triglav start")