0

Im using capistrano to deploy PHP projects which all works perfectly I am now introducing multistage, which I have also got working no problem

In my actual application setup I like to store the files in a differnt format

eg

/

..application/

....deploy/deploy.rb

....deploy/production.rb

..configs (etc)

I understand the default is config/deploy/production.rb This dosent follow my applications say up, so is there anyway to define which path to use?

Capfile:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

load 'application/deploy/deploy' # remove this line to skip loading any of the default tasks

Community
  • 1
  • 1
nick-ls
  • 11
  • 3

1 Answers1

0

I only use one file: config/deploy.rb with multiple tasks. Ignore the RVM business if you don't use it. Like this:

task :staging do
  set :rails_env, 'staging'
  role :app, "staging.example.com"
  role :web, "staging.example.com"
  role :db,  "staging.example.com", :primary => true
end

task :production do
  set :rails_env, 'production'
  set :branch, 'master'
  # RVM integration as specified at https://rvm.beginrescueend.com/integration/capistrano/
  $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
  require "rvm/capistrano"
  set :rvm_ruby_string, 'ruby-version@gemset'
  set :rvm_type, :user

  role :app, "prod.example.com"
  role :web, "prod.example.com"
  role :db,  "prod.example.com", :primary => true
end

Then you deploy with cap staging deploy and cap production deploy.

JohnColvin
  • 2,489
  • 1
  • 14
  • 8
  • This is much better approach but I cant get it working But at the command line I get the following `$ cap production deploy:setup * executing `production' triggering start callbacks for `deploy:setup' * executing `multistage:ensure' No stage specified. Please specify one of: production, review, staging (e.g. `cap production deploy:setup') $ cap staging deploy:setup * executing `staging' triggering start callbacks for `deploy:setup' * executing `multistage:ensure' No stage specified. Please specify one of: production, review, staging (e.g. `cap production deploy:setup')` – nick-ls Mar 13 '12 at 11:40