diff --git a/config/deploy.rb b/config/deploy.rb index 710139084..d2699f716 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -43,6 +43,7 @@ namespace :deploy do # before :deploy, "deploy:check_revision" before :deploy, 'deploy:run_tests' + after :deploy, 'permissions:load' desc 'Restart application' task :restart do diff --git a/lib/capistrano/tasks/load_permissions.cap b/lib/capistrano/tasks/load_permissions.cap new file mode 100644 index 000000000..bd2602ace --- /dev/null +++ b/lib/capistrano/tasks/load_permissions.cap @@ -0,0 +1,11 @@ +namespace :deploy do + namespace :permissions do + desc 'Reload permissions table' + task :load do + on roles(:all) do + execute "cd #{deploy_to}/current && #{fetch(:rbenv_prefix)} bundle exec "\ + "rake permissions:load RAILS_ENV=#{fetch(:rails_env)}" + end + end + end +end