예제 #1
0
def add_upstart(name, content):
    if name.endswith(".conf"):
        name = name[:-5]

    upstart_file = "/etc/init/%s.conf" % name

    with ctx.sudo():
        with ctx.unpatched_state():
            file.write(upstart_file, content)
예제 #2
0
    def _upload(self):
        # TODO Warn if there are local changes
        tmp_tar = git.create_archive(self.revision)

        try:
            core.put(tmp_tar, "deploy.tar.gz")
            core.run("tar -xzf deploy.tar.gz")
            file.remove("deploy.tar.gz")

            with ctx.unpatched_state():
                file.write("VERSION", git.revparse(self.revision))
        finally:
            core.local("rm -rf %s" % tmp_tar)
예제 #3
0
    def _upload(self):
        # TODO Warn if there are local changes
        tmp_tar = git.create_archive(self.revision)

        try:
            core.put(tmp_tar, "deploy.tar.gz")
            core.run("tar -xzf deploy.tar.gz")
            file.remove("deploy.tar.gz")

            with ctx.unpatched_state():
                file.write("VERSION", git.revparse(self.revision))
        finally:
            core.local("rm -rf %s" % tmp_tar)
예제 #4
0
def command(name, command):
    initd_file = "/etc/init.d/%s" % name
    upstart_file = "/etc/init/%s.conf" % name

    if file.exists(upstart_file):
        cmd = "%s %s" % (command, name)
    elif file.exists(initd_file):
        cmd = "%s %s" % (initd_file, command)
    else:
        cmd = "false"

    with ctx.unpatched_state():
        core.sudo(cmd)
예제 #5
0
파일: core.py 프로젝트: imankulov/revolver
def put(*args, **kwargs):
    with _ctx.unpatched_state():
        return _put(*args, **kwargs)
예제 #6
0
def put(*args, **kwargs):
    with _ctx.unpatched_state():
        return _put(*args, **kwargs)