~ihabunek/triglav

ref: 837d6e21f3fc80e932ea631bb402f346769c4154 triglav/fabfile.py -rw-r--r-- 684 bytes
837d6e21Ivan Habunek Reorganize validator to use new data 6 months ago
                                                                                
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
import getpass

from fabric import task
from invoke import Collection, run


@task()
def deploy(c):
    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")


sudo_pass = getpass.getpass("What's your sudo password? ")

ns = Collection(deploy)
ns.configure({'sudo': {'password': sudo_pass}})