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

Interactive command output not shown #3667

Closed
ochorocho opened this issue Aug 10, 2023 · 1 comment · Fixed by #3674
Closed

Interactive command output not shown #3667

ochorocho opened this issue Aug 10, 2023 · 1 comment · Fixed by #3674

Comments

@ochorocho
Copy link
Contributor

ochorocho commented Aug 10, 2023

  • Deployer version: 7.3.1

  • Deployment OS: php:8.1-cli-alpine (Docker)

I have the following task. This task will simply run ./vendor/bin/typo3 setup on the remote server using symfony/process:

task('typo3:setup-if-needed', function () {
    cd('{{release_path}}');
    $decorator = output()->isDecorated();
    set('decorator', false);
    $remote = get('remote_user') . '@' . get('hostname');
    $binary = get('release_path') . '/vendor/bin/typo3';
    $process = new Process(['ssh', '-t', $remote,  $binary, 'setup']);
    $process->setTty(true);
    $process->run();
    set('decorator', $decorator);
});

This command is interactive, so user input ist required.

I tried using the run('{{bin/typo3}} setup'); and set ssh_arguments: ['-tt'] function provided by deployer, but this leaves the cli stuck without showing the interactive questions:
Bildschirmfoto 2023-08-10 um 09 15 09

Without the ssh_arguments: ['-tt'] the task fails:

[staging] ssh '-A' '-o' 'ControlMaster=auto' '-o' 'ControlPersist=60' '-o' 'ControlPath=~/.ssh/redittemplate@template.knallimall.org' 'redittemplate@template.knallimall.org' ': a9ba5c417eb370a0e4ae; bash -ls'
[staging] run cd /var/www/clients/client1/web89/home/redittemplate/web/typo3/releases/8 && (vendor/bin/typo3 setup)
[staging] Configuration already exists do you want to overwrite it [default: no] ?
[staging]  error  in deploy.php on line 101:
[staging] exit code 1 (General error)
done typo3:setup-if-needed 12s 510ms

Is there a way to run interactive commands on the server?

@antonmedv
Copy link
Member

Right now it is not possible. As each task is executed in a separate process.

ochorocho added a commit to ochorocho/deployerphp that referenced this issue Aug 24, 2023
* Update recipe for TYPO3 v12
* Allow tasks to be added before or after a task in a given task group
* Allow to hide spinner to enable interactive tasks on be run on the remote server

Fixes deployphp#3667
antonmedv pushed a commit that referenced this issue Sep 13, 2023
* [TASK] Update TYPO3 recipe

* Update recipe for TYPO3 v12
* Allow tasks to be added before or after a task in a given task group
* Allow to hide spinner to enable interactive tasks on be run on the remote server

Fixes #3667

* [TASK] Update docs

* [TASK] Remove deploy:vendors from recipe

We aim for minimal requirements on the target server.
Thus, all preparation should be done in CI.

* [TASK] Update comment
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

Successfully merging a pull request may close this issue.

2 participants