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

V7 deployer local not work #2679

Closed
MishaSerbenyuk opened this issue Oct 6, 2021 · 3 comments
Closed

V7 deployer local not work #2679

MishaSerbenyuk opened this issue Oct 6, 2021 · 3 comments

Comments

@MishaSerbenyuk
Copy link

MishaSerbenyuk commented Oct 6, 2021

  • Deployer version: 7.0.0-beta.26
  • Deployment OS: Centos 7

Hi
I try upgrade my deploy.php from deployer 6.x to 7.x but I have problem with local tasks
I have this configuration in deployer 6.x

desc('Build Artifact');
task('build', function () {
    set('deploy_path', '.');
    set('release_path', '.');
    set('current_path', '.');
    $origStaticOptions = get('static_deploy_options');
    set('static_deploy_options', '-f ' . $origStaticOptions);

    invoke('deploy:vendors');
    invoke('artifact:package');
})->local();
localhost('build');

But when I run this by command

dep -f /deploy.php build

I got error

In SelectCommand.php line 80:
                                  
  [Deployer\Exception\Exception]  
  No host selected.               
                                  

Exception trace:
  at phar:///usr/local/bin/dep/src/Command/SelectCommand.php:80
 Deployer\Command\SelectCommand->selectHosts() at phar:///usr/local/bin/dep/src/Command/MainCommand.php:96
 Deployer\Command\MainCommand->execute() at phar:///usr/local/bin/dep/vendor/symfony/console/Command/Command.php:299
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:978
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:295
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:167
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/dep/src/Deployer.php:304
 Deployer\Deployer::run() at phar:///usr/local/bin/dep/bin/dep:104
 require() at /usr/local/bin/dep:4

build [--tag TAG] [--revision REVISION] [--branch BRANCH] [-o|--option OPTION] [-l|--limit LIMIT] [--no-hooks] [--plan] [--start-from START-FROM] [--log LOG] [--profile PROFILE] [--] [<selector>...]

Where my mistake ?
Thanks

@antonmedv
Copy link
Member

<?php
namespace Deployer;
require 'recipe/common.php';
desc('Build Artifact');
task('build', function () {
    set('deploy_path', '.');
    set('release_path', '.');
    set('current_path', '.');
    $origStaticOptions = get('static_deploy_options');
    set('static_deploy_options', '-f ' . $origStaticOptions);

    invoke('deploy:vendors');
    invoke('artifact:package');
})->local();
localhost('build');

Works:

dep -f deploy.php build 
task build
task deploy:vendors
[build]  InvalidArgumentException  in TaskCollection.php on line 20:
[build]
[build]   Task `artifact:package` not found.
[build]

@schmengler
Copy link
Contributor

@antonmedv Not anymore. What are we supposed to use instead of ->local() now to enforce tasks running locally? I've looked into selector syntax but couldn't find anything

@wilfriedwolf
Copy link
Contributor

wilfriedwolf commented Nov 2, 2022

Would that be a solution?

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

4 participants