capistrano / laravel

Gem for deploying Laravel projects with capistrano v3.*
MIT License
222 stars 71 forks source link

Why is migrations commented out? #4

Closed allaire closed 8 years ago

allaire commented 10 years ago

The migration task is commented out and not up to date. I currently have:

namespace :deploy do
  task :migrate do
    invoke 'laravel:artisan', 'migrate'
  end
end

should it be updated with the code above?

peterjmit commented 10 years ago

There is no good reason for it being commented out, other than omission on my part! I will update this. Thanks for all your feedback :+1:

drbild commented 10 years ago

Will this be updated?

allaire commented 10 years ago

@peterjmit I think the within is not necessary, since it's already in the laravel:artisan command: https://github.com/capistrano/laravel/blob/master/lib/capistrano/tasks/migrations.rake#L3

allaire commented 10 years ago

Also, @peterjmit, Any idea why the after hook is not working in this case?

namespace :deploy do
  task :migrate do
    puts "Running migrations..."
    invoke 'laravel:artisan', 'migrate'
  end
  after :updated, 'deploy:set_permissions:chmod'
end

# TODO: Run manually, after hook is not working
# after 'deploy:updated', 'deploy:migrate'

When deploying in verbose mode using the after hook I get:

...
** Invoke deploy:migrate (first_time)
** Execute deploy:migrate
Running migrations...
** Invoke laravel:artisan
...

But when I run the command cap production deploy:migrate -v --trace directly I get:

** Invoke deploy:migrate (first_time)
** Execute deploy:migrate
Running migrations...
** Invoke laravel:artisan (first_time)
** Execute laravel:artisan
INFO[0fdde119] Running /usr/bin/env php artisan migrate --env=production on production.site.com

Any idea why? maybe @leehambley can chime in?

peterjmit commented 10 years ago

@allaire off the top of my head might well be due to rake only allowing tasks to execute once, this was fixed in http://github.com/capistrano/symfony, I will see if I can fix it here too

allaire commented 10 years ago

@peterjmit Where can I read more about this issue?

c0ntax commented 10 years ago

I've noticed that although the codebase has been updated to comment back in the database migration (https://github.com/capistrano/laravel/commit/8f84614dda5a82c9979683e8bcc4de60e389464f) if you do a gem install of it, you get the commented out version.

javierseixas commented 9 years ago

Same to me. I guess something should be updated in the gems repository. The version 0.0.2 is too old: https://rubygems.org/gems/capistrano-laravel

ikari7789 commented 8 years ago

Sorry for the late response. I'll be helping maintain this plugin for the foreseeable future. If any of these issues are still persisting (all of the tickets are quite old), please let me know and I will do what I can to try and help fix things.

mcblum commented 8 years ago

@ikari7789 I ran into this issue today. I tried running invoke 'laravel:artisan', 'migrate' and I got an error that it had already been invoked. Also when I use the build in migration method it says Application in Production -- command cancelled

ikari7789 commented 8 years ago

@mcblum PR #20 should have fixed this. I'll release a minor version update shortly with the fix. Additionally, there is a laravel:migrate_db task which will run migrations.