Last active
June 13, 2017 09:56
-
-
Save Ducain/edaaf4644d71601f4334 to your computer and use it in GitHub Desktop.
Capistrano 3 running Phinx migrations on Windows server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after "deploy:updating", "deploy:phinx_migrations" | |
namespace :deploy do | |
task :restart do ; end | |
desc 'Run Phinx migrations' | |
task :phinx_migrations do | |
on roles(:app) do | |
within release_path do | |
execute 'php', 'vendor/robmorgan/phinx/bin/phinx', 'migrate', '-e', 'production', raise_on_non_zero_exit: false | |
end | |
end | |
end | |
end |
Additional info: this is running on a Windows server, and I couldn't execute the 'vendor/bin/phinx' symlink, so I had to execute using the full path to the phinx file.
This is exactly what I was looking for. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding raise_on_non_zero_exit: false is necessary because the Phinx process exits with no message, and the default behavior in Capistrano is to abort in that case.