Sha256: e769efd73bbb987396742b859e5f63e416694e6964a5652324c3fd61f0a6f2d9

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

require "capistrano-rails-server/recipes/common"

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
  namespace :deploy do
    desc "Install everything onto the server"
    task :install do
      run "#{sudo} apt-get -y update"
      run "#{sudo} apt-get -y install python-software-properties software-properties-common"
    end

    # Overwrite with no sudo
    desc <<-DESC
      Prepares one or more servers for deployment. Before you can use any \
      of the Capistrano deployment tasks with your project, you will need to \
      make sure all of your servers have been prepared with `cap deploy:setup'. When \
      you add a new server to your cluster, you can easily run the setup task \
      on just that server by specifying the HOSTS environment variable:

        $ cap HOSTS=new.server.com deploy:setup

      It is safe to run this task on servers that have already been set up; it \
      will not destroy any deployed revisions or data.
    DESC
    task :setup, :except => { :no_release => true } do
      dirs = [deploy_to, releases_path, shared_path]
      dirs += shared_children.map { |d| File.join(shared_path, d.split('/').last) }
      run "mkdir -p #{dirs.join(' ')}"
      run "chmod g+w #{dirs.join(' ')}" if fetch(:group_writable, true)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-rails-server-1.2.0 lib/capistrano-rails-server/recipes/base.rb
capistrano-rails-server-1.1 lib/capistrano-rails-server/recipes/base.rb