Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to run a console command? #28

Closed
jurgenweber opened this issue Aug 15, 2014 · 3 comments
Closed

how to run a console command? #28

jurgenweber opened this issue Aug 15, 2014 · 3 comments

Comments

@jurgenweber
Copy link

I found in your readme...

namespace :deploy do
  task :migrate do
    invoke 'symfony:console', 'doctrine:migrations:migrate', '--no-interaction', 'db'
  end
end

but

SSHKit::Runner::ExecuteError: Exception while executing on host vagrant-front01.local: Don't know how to build task 'symfony:console'

I think found in issue 10, to use symfony:command but

SSHKit::Runner::ExecuteError: Exception while executing on host vagrant-front01.local: Don't know how to build task 'symfony:command'

my code:

task :before_symlink do
  on roles(:front) do |host|
    #generate browser detection cache file
    invoke 'symfony:command', 'browscap:update'

    #dump assets (if using assetic)"
    invoke 'symfony:command', 'assetic:dump'

    #set queue attributes
    invoke 'symfony:command', 'app:queue:sqs:set-attributes'

    #translations
    invoke 'symfony:command', 'app:translation:sync'
  end
end

namespace :deploy do
  before :starting, 'composer:install_executable'

  before :publishing, 'before_symlink'

  after :finishing, "deploy:cleanup"
end

how can I run a console command? :0

Versions:
gem list | grep capistrano
capistrano (3.2.1, 2.15.5)
capistrano-composer (0.0.4)
capistrano-file-permissions (0.1.0)
capistrano-symfony (0.3.0)

I did just find this thuo:
https://github.com/capistrano/symfony/blob/master/lib/capistrano/tasks/symfony.rake#L21

ok, i'll go back to symfony:console.

@jurgenweber
Copy link
Author

ok, so... am I using another fork? or something that looks very similar but isn't the same?

cd /var/lib/gems/1.9.1/gems/capistrano-symfony-0.3.0#, looking at the readme:

### Executing symfony console commands on the server directly from the local CLI

This library also provides a `symfony:run` task which allows access to any
Symfony console command.

With log level set to debug, from the command line you can run:

```bash
$ cap production symfony:run['list --env=prod']

Or from within a rake task using capistrano's invoke:

task :my_custom_composer_task do
  invoke 'symfony:run', :'assets:install'
end

@jurgenweber
Copy link
Author

yes, yes I am.. for the unaware... gem install capistrano-symfony != to this git repo!

check it out, and

gem build capistrano-symfony.gemspec
gem install capistrano-symfony-0.2.0.gem

@peterjmit
Copy link
Contributor

This has since been fixed

See

  • gem.post_install_message = <<eos
    WARNING - This gem has switched repositories. This gem is now for the
    capitrano-symfony plugin located at https://github.com/capistrano/symfony.
    This package behaves differently from the previous, and the release versions
    have changed.
    The Big Brains Company and Thomas Tourlourat (@armetiz) kindly agreed to
    transfer the ownership of this gem over to the Capistrano organization. The
    previous repository can be found here https://github.com/TheBigBrainsCompany/capistrano-symfony
    eos
  • https://github.com/capistrano/symfony/releases/tag/0.4.0

Sorry for any confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants