Skip to content

Commit

Permalink
Merged Cap changes from po_extra
Browse files Browse the repository at this point in the history
  • Loading branch information
martent committed Jan 10, 2019
1 parent f10ed10 commit 794f278
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

set :rbenv_type, :user
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
set :default_env, { path: '$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH' }
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_ruby, File.read('.ruby-version').strip
set :rbenv_roles, :all

set :application, 'meks'
set :repo_url, "https://github.com/malmostad/#{fetch(:application)}.git"
Expand All @@ -22,7 +26,6 @@
set :linked_files, %w{config/database.yml config/secrets.yml }
set :linked_dirs, %w{log tmp/pids tmp/sockets reports}

set :default_env, { path: '$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH' }
set :keep_releases, 5

namespace :unicorn do
Expand All @@ -43,6 +46,24 @@
end
end

namespace :delayed_job do
desc 'Restart delayed job daemon'
task :restart do
on roles(:app) do
execute "cd #{fetch(:deploy_to)}/current && RAILS_ENV=#{fetch(:rails_env)} $HOME/.rbenv/bin/rbenv exec bundle exec ./bin/delayed_job restart"
end
end
end

namespace :cache do
desc 'Clear Rails cache with rake task'
task :clear do
on roles(:app) do
execute "cd #{fetch(:deploy_to)}/current && $HOME/.rbenv/bin/rbenv exec bundle exec rake cache:clear RAILS_ENV=#{fetch(:rails_env)}"
end
end
end

namespace :deploy do
desc "Copy vendor statics"
task :copy_vendor_statics do
Expand Down Expand Up @@ -90,24 +111,6 @@
end
end

namespace :delayed_job do
desc 'Restart delayed job daemon'
task :restart do
on roles(:app) do
run("cd #{fetch(deploy_to)}/current && bin/delayed_job restart RAILS_ENV=#{fetch(:rails_env)}")
end
end
end

namespace :cache do
desc 'Clear Rails cache with rake task'
task :clear do
on roles(:app) do
run("cd #{fetch(deploy_to)}/current && bundle exec rake cache:clear RAILS_ENV=#{fetch(:rails_env)}")
end
end
end

before :starting, 'deploy:are_you_sure'
before :starting, 'deploy:check_revision'
before :compile_assets, 'deploy:copy_vendor_statics'
Expand Down

0 comments on commit 794f278

Please sign in to comment.