Sha256: 9b4f4a9e74903fdfea771281f4080e496350b4ad6587624d85274297fe79ab96

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

Standup.script :node do
  def run
    scripts.ec2.open_port 80, 443
    
    if install_gem('passenger', '3.0.4') || !file_exists?('/opt/nginx/sbin/nginx')
      install_package 'libcurl4-openssl-dev'
      sudo 'passenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx'
    end
    
    sudo 'mkdir -p /opt/nginx/conf/servers'
    
    upload script_file('nginx.conf'),
           :to =>'/opt/nginx/conf/nginx.conf',
           :sudo => true
    
    upload script_file('nginx'),
           :to =>'/etc/init.d/nginx',
           :sudo => true
    
    sudo 'chmod +x /etc/init.d/nginx'
    sudo '/usr/sbin/update-rc.d -f nginx defaults'
    
    scripts.monit.add_watch script_file('nginx_monit.conf')
    
    restart_nginx
  end
  
  def add_server_conf file, name = File.basename(file), restart = true
    upload file,
           :to   => "/opt/nginx/conf/servers/#{name}",
           :sudo => true
    
    restart_nginx if restart
  end
  
  def restart_nginx
    scripts.monit.restart_watch 'nginx'
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
standup-0.4.0 scripts/passenger.rb
standup-0.3.37 scripts/passenger.rb
standup-0.3.36 scripts/passenger.rb
standup-0.3.35 scripts/passenger.rb
standup-0.3.34 scripts/passenger.rb
standup-0.3.33 scripts/passenger.rb
standup-0.3.32 scripts/passenger.rb
standup-0.3.31 scripts/passenger.rb
standup-0.3.30 scripts/passenger.rb
standup-0.3.29 scripts/passenger.rb
standup-0.3.28 scripts/passenger.rb
standup-0.3.27 scripts/passenger.rb
standup-0.3.26 scripts/passenger.rb
standup-0.3.25 scripts/passenger.rb
standup-0.3.24 scripts/passenger.rb
standup-0.3.23 scripts/passenger.rb
standup-0.3.22 scripts/passenger.rb
standup-0.3.20 scripts/passenger.rb
standup-0.3.19 scripts/passenger.rb
standup-0.3.18 scripts/passenger.rb