Ejemplo n.º 1
0
def install_with_passenger(nginx = '1.6.1', passenger = '4.0.50'):
  rbenv.install
  sudo('gem install rack --no-document')
  yum.install('wget curl-devel gcc gcc-c++ openssl-devel pcre-devel zlib-devel')
  with cd(env.src_dir):
    _setup_source(nginx)
    if not exists('passenger-%s.tar.gz' % passenger):
      sudo('wget http://s3.amazonaws.com/phusion-passenger/releases/passenger-%s.tar.gz' % passenger)
    if not exists('passenger-%s' % passenger):
      sudo('tar zxfv passenger-%s.tar.gz' % passenger)
    if exists('/opt/passenger-%s' % passenger):
      sudo('rm -rf /opt/passenger-%s' % passenger)
    sudo('mv passenger-%s /opt/' % passenger)
    with cd('/opt/passenger-%s' % passenger):
      sudo('./bin/passenger-install-nginx-module --auto --prefix=/etc/nginx --nginx-source-dir=%s/nginx-%s  --languages=ruby,python,nodejs --extra-configure-flags="%s"' % (env.src_dir, nginx, env.nginx_build_option))
    _cleanup_source(nginx)
  _setup_config
  ruby_version = sudo('rbenv version-name') 
  sed('/etc/nginx/nginx.conf',
      '(^    access_log .*$)',
      '\\1\\n\\n    passenger_root /opt/passenger-%s;\\n    passenger_ruby /opt/rbenv/versions/%s/bin/ruby;' % (passenger, ruby_version),
      use_sudo = True,
      backup = None
  )
  _setup_init_script
Ejemplo n.º 2
0
def install():
  yum.install('git')
  if not exists(env.nvm_root):
    sudo('git clone https://github.com/creationix/nvm.git %s' % env.nvm_root)
  with cd(env.nvm_root):
   sudo('git checkout `git describe --abbrev=0 --tags`') 
  sudo('cat /dev/null > /etc/profile.d/nvm.sh')
  sudo('echo \'source %s/nvm.sh\' >> /etc/profile.d/nvm.sh' % env.nvm_root)
  sudo('source /etc/profile.d/nvm.sh')
  install_nodejs('0.10')
  use('0.10')
Ejemplo n.º 3
0
def install(version = '1.6.1'):
  yum.install('wget gcc pcre-devel zlib-devel')
  with cd(env.src_dir):
    _setup_source(version)
    with cd('nginx-%s' % version):
      sudo('./configure %s' % env.nginx_build_option)
      sudo('make')
      sudo('make install')
    _cleanup_source(version)
  _setup_config
  _setup_init_script
Ejemplo n.º 4
0
def install():
    yum.install("git")
    pyenv_root = env.pyenv_root
    if not exists(pyenv_root):
        sudo("git clone https://github.com/yyuu/pyenv.git %s" % pyenv_root)
    sudo("cat /dev/null > /etc/profile.d/pyenv.sh")
    sudo("echo 'export PYENV_ROOT=%s' >> /etc/profile.d/pyenv.sh" % env.pyenv_root)
    sudo("echo 'export PATH=\"$PYENV_ROOT/bin:$PATH\"' >> /etc/profile.d/pyenv.sh")
    sudo("echo 'eval \"$(pyenv init -)\"' >> /etc/profile.d/pyenv.sh")
    sudo("source /etc/profile.d/pyenv.sh")
    install_python("2.7.8")
    sudo("pyenv global 2.7.8")
Ejemplo n.º 5
0
def install():
  yum.install('git')
  rbenv_root = env.rbenv_root
  if not exists(rbenv_root):
    sudo('git clone https://github.com/sstephenson/rbenv.git %s' % rbenv_root)
  install_plugin('ruby-build')
  sudo('cat /dev/null > /etc/profile.d/rbenv.sh')
  sudo('echo \'export RBENV_ROOT=%s\' >> /etc/profile.d/rbenv.sh' % env.rbenv_root)
  sudo('echo \'export PATH="$RBENV_ROOT/bin:$PATH"\' >> /etc/profile.d/rbenv.sh')
  sudo('echo \'eval "$(rbenv init -)"\' >> /etc/profile.d/rbenv.sh')
  sudo('source /etc/profile.d/rbenv.sh')
  install_ruby('2.1.2')
  sudo('rbenv global 2.1.2')
Ejemplo n.º 6
0
def install_python(version):
    yum.install("gcc readline-devel openssl-devel bzip2-devel sqlite-devel")
    res = run("pyenv versions | grep %s" % version, warn_only=True, quiet=True)
    if not res.succeeded:
        sudo("pyenv install %s" % version)
Ejemplo n.º 7
0
def install_ruby(version):
  yum.install('gcc readline-devel openssl-devel')
  res=run('rbenv versions | grep %s' % version, warn_only=True, quiet=True)
  if not res.succeeded:
    sudo('rbenv install %s' % version)
Ejemplo n.º 8
0
def install_nodejs(version):
  yum.install('gcc gcc-c++ openssl-devel')
  res=run('nvm ls | grep %s' % version, warn_only=True, quiet=True)
  if not res.succeeded:
    sudo('nvm install %s' % version)