Beispiel #1
0
    def _layout(self):
        current_user = core.run("echo $USER").stdout

        for type, path in self.folders.iteritems():
            if not dir.exists(path):
                if type != "current":
                    dir.create(path, recursive=True)
            else:
                with ctx.sudo():
                    dir.attributes(path, owner=current_user, recursive=True)
Beispiel #2
0
    def _layout(self):
        current_user = core.run("echo $USER").stdout

        for type, path in self.folders.iteritems():
            if not dir.exists(path):
                if type != "current":
                    dir.create(path, recursive=True)
            else:
                with ctx.sudo():
                    dir.attributes(path, owner=current_user, recursive=True)
Beispiel #3
0
def install():
    package.ensure("git-core")

    if not dir.exists(".rbenv"):
        run("git clone git://github.com/sstephenson/rbenv.git .rbenv")
    else:
        with ctx.cd(".rbenv"):
            run("git pull")

    _ensure_autoload(".bashrc")
    _ensure_autoload(".zshrc")
Beispiel #4
0
def install():
    package.ensure(["git-core", "libssl-dev", "curl", "build-essential"])

    if not dir.exists(".nvm"):
        run("git clone git://github.com/creationix/nvm.git .nvm")
    else:
        with ctx.cd(".nvm"):
            run("git pull")

    _ensure_autoload(".bashrc")
    _ensure_autoload(".zshrc")
Beispiel #5
0
def install():
    package.ensure(["git-core", "openjdk-7-jre"])

    if not dir.exists(".awsenv"):
        run("git clone git://github.com/michaelcontento/awsenv.git .awsenv")
        return

    with ctx.cd(".awsenv"):
        run("git pull")

    _ensure_autoload(".bashrc")
    _ensure_autoload(".zshrc")
Beispiel #6
0
def install():
    package.ensure(["curl", "git-core"])

    url = "https://raw.github.com/CHH/phpenv/master/bin/phpenv-install.sh"
    if not dir.exists(".phpenv"):
        run("curl -s %s | bash" % url)
    else:
        run("curl -s %s | UPDATE=yes bash" % url)

    dir.create(".phpenv/versions")

    _ensure_autoload(".bashrc")
    _ensure_autoload(".zshrc")
Beispiel #7
0
def install():
    package.ensure(["curl", "git-core"])

    if not dir.exists(".php-build"):
        core.run("git clone git://github.com/CHH/php-build .php-build")

    with ctx.cd(".php-build"):
        core.run("git pull")
        dir.create("versions")
        dir.create("tmp")

    _ensure_autoload(".bashrc")
    _ensure_autoload(".zshrc")
Beispiel #8
0
def install():
    package.ensure("git-core")
    package.ensure([
        "build-essential", "zlib1g-dev", "libssl-dev",
        "libxml2-dev", "libsqlite3-dev"
    ])
    ruby_rbenv.ensure()

    dir.ensure(".rbenv/plugins")
    with ctx.cd(".rbenv/plugins"):
        if not dir.exists("ruby-build"):
            run("git clone git://github.com/sstephenson/ruby-build.git")
            return

        with ctx.cd("ruby-build"):
            run("git pull")
Beispiel #9
0
def install():
    package.ensure("git-core")
    package.ensure([
        "build-essential", "zlib1g-dev", "libssl-dev", "libxml2-dev",
        "libsqlite3-dev"
    ])
    ruby_rbenv.ensure()

    dir.ensure(".rbenv/plugins")
    with ctx.cd(".rbenv/plugins"):
        if not dir.exists("ruby-build"):
            run("git clone git://github.com/sstephenson/ruby-build.git")
            return

        with ctx.cd("ruby-build"):
            run("git pull")
Beispiel #10
0
def install():
    already_installed = package.is_installed('nginx')

    if server.version == '10.04':
        package.install_ppa('nginx/stable')
    package.install('nginx')

    if not already_installed:
        site_disable('default')

    www_dir = '/var/www'
    www_owner = 'www-data'
    if not dir.exists(www_dir):
        with ctx.sudo():
            dir.create(www_dir)
            dir.attributes(www_dir, owner=www_owner, group=www_owner)

    restart()
Beispiel #11
0
def _ensure_layout(owner):
    home_dir = user.home_directory(owner)
    repo_name = git.repository_name()

    join = os.path.join
    project_dir = join(home_dir, repo_name)

    paths = {
        'project':  join(project_dir),
        'current':  join(project_dir, 'current'),
        'releases': join(project_dir, 'releases'), 
        'shared':   join(project_dir, 'shared'),
        'logs':     join(project_dir, 'shared', 'logs'),
        'temp':     join(project_dir, 'shared', 'temp')
    }

    with ctx.sudo(owner):
        for path in paths.itervalues():
            if dir.exists(path): 
                continue
            dir.create(path, recursive=True)

    return paths
Beispiel #12
0
def ensure():
    if not dir.exists(".rbenv/plugins/ruby-build"):
        install()
Beispiel #13
0
def ensure():
    if not dir.exists(".php-build"):
        install()
Beispiel #14
0
def ensure():
    if not dir.exists(".rbenv/plugins/ruby-build"):
        install()
Beispiel #15
0
def ensure():
    if not dir.exists(".awsenv"):
        install()
Beispiel #16
0
def inside():
    return dir.exists("/vagrant") and user.exists("vagrant")
Beispiel #17
0
def inside():
    return dir.exists('/vagrant') and user.exists('vagrant')
Beispiel #18
0
def ensure():
    if not dir.exists(".nvm"):
        install()
Beispiel #19
0
def _symlink_release(owner, current_dir, release_dir):
    with ctx.sudo(owner):
        if dir.exists(current_dir):
            dir.remove(current_dir, recursive=True)
        file.link(release_dir, current_dir)
Beispiel #20
0
def inside():
    return dir.exists("/vagrant") and user.exists("vagrant")