Capistrano and Phing

584 Views Asked by At

I've got some trouble to execute a phing script with capistrano v3.

This is what I got so far.

desc 'build'
  task :build do
    on roles(:web) do
      within release_path do
        execute "cd", "#{release_path}/build", "&&", "phing build"
      end
    end
  end
after :updated, 'deploy:build'

Result:

 INFO [d4208b76] Running /usr/bin/env cd /var/www/capistrano/simform/releases/20131208111121/build && phing build on localhost
DEBUG [d4208b76] Command: cd /var/www/capistrano/simform/releases/20131208111121 && /usr/bin/env cd /var/www/capistrano/simform/releases/20131208111121/build && phing build
DEBUG [d4208b76]    /usr/bin/env: 
DEBUG [d4208b76]    cd
DEBUG [d4208b76]    : No such file or directory
DEBUG [d4208b76]    
cap aborted!
cd stdout: Nothing written
cd stderr: Nothing written

Why do I get: "No such file or directory"?

1

There are 1 best solutions below

0
On

Ah I see what I did wrong, the task should be like this:

 
    desc 'build'
      task :build do
        on roles(:web) do
          within release_path do
            execute "cd #{release_path}/build && phing build"
          end
        end
      end

      after :updated, 'deploy:build'