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

"The "stage" argument does not exist" on parallel deploy #1299

Closed
blumfontein opened this issue Jul 13, 2017 · 1 comment
Closed

"The "stage" argument does not exist" on parallel deploy #1299

blumfontein opened this issue Jul 13, 2017 · 1 comment
Labels

Comments

@blumfontein
Copy link

Q A
Issue Type Bug
Deployer Version 5.1.3
Local Machine OS MAC OSX
Remote Machine OS Ubuntu 16.04

Description

Hi. I do deploy on 2 hosts. When I do "dep deploy my_stage -vvv" everything is ok. But when I do "dep deploy my_stage -vvv --parallel", deploy falls with "SymfonyException The "stage" argument does not exist". It rises on the line with "$stage = input()->getArgument('stage');"

Steps to reproduce

Content of deploy.php

<?php

namespace Deployer;

require 'vendor/deployer/deployer/recipe/common.php';

set('repository', 'git@some/repo.git');
set('git_cache', true);
set('shared_dirs', ['tmp/logs']);
set('writable_dirs', ['tmp/cache', 'tmp/twig']);
set('writable_mode', 'chmod');
set('keep_releases', 10);
set('ssh_multiplexing', false);

host('node1')
    ->hostname('some_hostname1')
    ->user('user')
    ->configFile('~/.ssh/config')
    ->identityFile('~/.ssh/id_rsa')
    ->port(12345)
    ->stage('my_stage')
    ->set('branch', 'master')
    ->set('deploy_path', '/home/user/site');

host('node2')
    ->hostname('some_hostname2')
    ->user('user')
    ->configFile('~/.ssh/config')
    ->identityFile('~/.ssh/id_rsa')
    ->port(12346)
    ->stage('my_stage')
    ->set('branch', 'master')
    ->set('deploy_path', '/home/user/site');

// Composer
desc('Installing Composer dependencies');
task('deploy:vendors', function () {
    $stage = input()->getArgument('stage');

    run("cd {{release_path}} && php composer.phar install --working-dir=vendor/{$stage} --prefer-dist --no-dev");
});

desc('Deploy project');
task('deploy', [
    'deploy:prepare',
    'deploy:lock',
    'deploy:release',
    'deploy:update_code',
    'deploy:shared',
    'deploy:writable',
    'deploy:vendors',
    'deploy:symlink',
    'deploy:unlock',
    'cleanup',
    'success'
]);

after('deploy:failed', 'deploy:unlock');

Output log

Executing task deploy:vendors

[Symfony\Component\Console\Exception\InvalidArgumentException] on [node]
The "stage" argument does not exist.

Exception trace:
() at /home/naimi/server/vendor/staging/vendor/symfony/console/Input/Input.php:118
Symfony\Component\Console\Input\Input->getArgument() at /home/naimi/server/deploy.php:64
Deployer\Deployer::Deployer{closure}() at n/a:n/a
call_user_func() at /home/naimi/server/vendor/staging/vendor/deployer/deployer/src/Task/Task.php:82
Deployer\Task\Task->run() at /home/naimi/server/vendor/staging/vendor/deployer/deployer/src/Console/WorkerCommand.php:99
Deployer\Console\WorkerCommand->doExecute() at /home/naimi/server/vendor/staging/vendor/deployer/deployer/src/Console/WorkerCommand.php:72
Deployer\Console\WorkerCommand->execute() at /home/naimi/server/vendor/staging/vendor/symfony/console/Command/Command.php:264
Symfony\Component\Console\Command\Command->run() at /home/naimi/server/vendor/staging/vendor/symfony/console/Application.php:869
Symfony\Component\Console\Application->doRunCommand() at /home/naimi/server/vendor/staging/vendor/deployer/deployer/src/Console/Application.php:132
Deployer\Console\Application->doRunCommand() at /home/naimi/server/vendor/staging/vendor/symfony/console/Application.php:223
Symfony\Component\Console\Application->doRun() at /home/naimi/server/vendor/staging/vendor/symfony/console/Application.php:130
Symfony\Component\Console\Application->run() at /home/naimi/server/vendor/staging/vendor/deployer/deployer/src/Deployer.php:320
Deployer\Deployer::run() at /home/naimi/server/vendor/staging/vendor/deployer/deployer/bin/dep:120

@antonmedv
Copy link
Member

Yeah, it's a bug. Will fix it.

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

No branches or pull requests

2 participants