12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- default_run_options[:pty] = true
- set :application, "huginn"
- set :deploy_to, "/home/you/app"
- set :user, "you"
- set :use_sudo, false
- set :scm, :git
- set :rails_env, 'production'
- set :repository, "git@github.com:you/huginn-private.git"
- set :branch, "master"
- set :deploy_via, :remote_cache
- set :keep_releases, 5
- set :bundle_without, [:development]
- server "yourdomain.com", :app, :web, :db, :primary => true
- set :sync_backups, 3
- before 'deploy:restart', 'deploy:migrate'
- after 'deploy', 'deploy:cleanup'
- set :bundle_without, [:development, :test]
- after 'deploy:update_code', 'deploy:symlink_configs'
- after 'deploy:update', 'foreman:export'
- after 'deploy:update', 'foreman:restart'
- namespace :deploy do
- desc 'Link the .env environment and Procfile from shared/config into the new deploy directory'
- task :symlink_configs, :roles => :app do
- run <<-CMD
- cd
- cd
- CMD
- end
- end
- namespace :foreman do
- desc "Export the Procfile to Ubuntu's upstart scripts"
- task :export, :roles => :app do
- run "cd #{latest_release} && rvmsudo bundle exec foreman export upstart /etc/init -a #{application} -u #{user} -l #{deploy_to}/upstart_logs"
- end
- desc 'Start the application services'
- task :start, :roles => :app do
- sudo "sudo start #{application}"
- end
- desc 'Stop the application services'
- task :stop, :roles => :app do
- sudo "sudo stop #{application}"
- end
- desc 'Restart the application services'
- task :restart, :roles => :app do
- run "sudo start #{application} || sudo restart #{application}"
- end
- end
- Dir[File.expand_path("../../lib/capistrano/*.rb", __FILE__)].each{|f| load f }
- require "bundler/capistrano"
- load 'deploy/assets'
|