Skip to content
fabfile.py 828 B
Newer Older
Yuanle Song's avatar
Yuanle Song committed
#!/usr/bin/env python
# coding=utf-8

"""
deploy to prod
"""

from fabric.api import env, sudo, run, local, hosts, put, cd, lcd

env.use_ssh_config = True


SERVER = 'de01'
Yuanle Song's avatar
Yuanle Song committed
FILES = "calc.html fifo.js fsm.js sw.js vendor favicon.ico README.org"
Yuanle Song's avatar
Yuanle Song committed

def deploy():
    with lcd("~/websites/rpn-calculator/"):
Yuanle Song's avatar
Yuanle Song committed
        local("rsync -irt %s"
              " %s:/var/www/emacsos.com/calc/" % (FILES, SERVER))
Yuanle Song's avatar
Yuanle Song committed


@hosts(SERVER)
def init():
Yuanle Song's avatar
Yuanle Song committed
    run("mkdir -p /var/www/emacsos.com/calc/")


def tar():
    """create an archive that can be run locally.

    obviously service worker won't work there.

    """
    local("tar czf rpn-calculator.tar.gz %s" % (FILES,))


def zip():
    """create an archive that can be run locally.

    obviously service worker won't work there.

    """
    local("zip -q -r rpn-calculator.zip %s" % (FILES,))