0

I am using capifony to deploy my symfony 2 application.

I run two late tasks. During the time grunt is run, my website is unavailable. I've tried to play around with tasks order without success.

How should I configure the following task or what else should I do to make sure my website does not become unavailable durint the grunt process (ideally, the simlink to current would be changed after the grunt command has finished) ?

after 'deploy:restart', 'deploy:dump_dev_assets'
after 'deploy:dump_dev_assets', 'deploy:grant_permissions'

namespace :deploy do
 desc "Dump dev assets"
  task :dump_dev_assets do
   run("cd #{deploy_to}/current && npm install")
   run("cd #{deploy_to}/current && bower install --allow-root")
   run("cd #{deploy_to}/current && grunt")
  end
end

namespace :deploy do
    desc "Grantpermissions"
    task :grant_permissions do
        run "sudo chmod -R 777 #{latest_release}/app/cache"
        run "sudo chmod -R 777 #{latest_release}/app/logs"
        run "sudo chmod -R 777 #{latest_release}/web/uploads"
        run "sudo chmod -R 777 #{latest_release}/web/media"
    end
end
Sébastien
  • 5,263
  • 11
  • 55
  • 116
  • 2
    It's a weird decision to run `grunt` in production environment. Normally you don't even have it to be installed there. The "correct" way is to build everything in some dedicated build environment then simply deploy artifacts to the production. – zerkms Aug 25 '15 at 10:19
  • hmmm, I did not know that... I'll do it then. thanks ;) – Sébastien Aug 25 '15 at 10:23

0 Answers0