Search code examples
deploymentcapistranoruby-on-rails-2

deploying with Capistrano within one file to different applications wi


I have a rails application "master" which i deploy with capistrano. It's deployed from master branch of the repository.
Then a new application was created "demo". it's code is stored in the demo branch of the same repository. I need to write deployment for that app.
it should do:
cap master deploy deployment of master application
cap demo deploy deployment of demo app

Currently when i put deployment of master in namespace it gives me an error

roles cannot be defined in a namespace (NotImplementedError)

and i need roles to restart application

desc "Restart Application"
  task :restart, :roles => :app do
    run "[ -f #{unicorn_pid} ] && kill -USR2 `cat #{unicorn_pid}` || #{unicorn_start_cmd}"
  end

How can i solve this issue?


Solution

  • Main point is that namespace & module can't be used here. But you always can

    task  :demo do
    # code here
    end
    

    using task won't result in an error