Deployer: Cannot run deploy on Windows

Created on 23 Jun 2017  Â·  8Comments  Â·  Source: deployphp/deployer

| Q | A
| ----------------- | ---
| Issue Type | Question
| Deployer Version | 5.1.1
| Local Machine OS | Windows 8.1
| Remote Machine OS | Linux Ubuntu 16

Description

I would like to deploy my Laravel application using Deployer in order to speed up and automate the deployment process.

Steps to reproduce

1) I successfully added deployer/deployer to my composer.json file and ran composer install
2) I have ran call vendor/bin/dep init and created a Laravel template
3) I have modified the deploy.php file (see below)
4) I call call vendor/bin/dep deploy api -vvv
5) error :(

Content of deploy.php

<?php
namespace Deployer;

require 'recipe/laravel.php';

// Configuration

set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('repository', 'user/project');
set('git_tty', true); // [Optional] Allocate tty for git on first deployment
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);

// Hosts

host('api')
    ->hostname('SSH-HOSTNAME')
    ->stage('production')
    ->user('SSH-USER')
    ->set('deploy_path', 'DEPLOY-PATH')
    ->forwardAgent();

// Tasks

desc('Restart PHP-FPM service');
task('php-fpm:restart', function () {
    // The user must have rights for restart service
    // /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
    run('sudo systemctl restart php-fpm.service');
});
after('deploy:symlink', 'php-fpm:restart');

// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

// Migrate database before symlink new release.

before('deploy:symlink', 'artisan:migrate');

Output log

>call vendor/bin/dep deploy api -vvv
➤ Executing task deploy:preparere
[api] > echo $0
[api] < ssh multiplexing initialization
SSH-USERNAME@api's password:
[api] < mm_send_fd: file descriptor passing not supported
[api] < mux_client_request_session: send fds failed
➤ Executing task deploy:faileded
• done on [api]i]
✔ Ok [1ms]s]
➤ Executing task deploy:unlockck
[api] > rm -f PATH-TO-DEPLOYMENT/.dep/deploy.lock
[api] < mm_send_fd: file descriptor passing not supported
[api] < mux_client_request_session: send fds failed


  [Deployer\Exception\RuntimeException (-1)]
  The command "rm -f PATH-TO-DEPLOYMENT/.dep/deploy.lock" failed.
  Exit Code: -1 (Unknown error)
  Host Name: api
  ================
  mm_send_fd: file descriptor passing not supported
  mux_client_request_session: send fds failed

Most helpful comment

Try add this:

set('ssh_multiplexing', false);

All 8 comments

Try add this:

set('ssh_multiplexing', false);

holy shit.. i feel really stupid 😭
How can i "remember the password"? currently i need to enter the password after each command to be executed?

This is - kind of - related to #1192 ?!

@johanmeiring you cannot - use identity file.

There is no way to enable SSH multiplexing on Windows.
Because of this, deploying process with Deployer 5 is twice as long compared with Deployer 4.

@waitxd try windows subsystem. I'll write an article later about using it.

@antonmedv Yes, I'm using WSL right now.

With WSL users have to duplicate their environment (install PHP, symlink keys), waste 1GB of disk space, keep in mind path differences (C:/ to /mnt/c) for custom tasks and use another console window.
It does sounds like a workaround though.

Another thing is the performance issue mentioned in https://github.com/Microsoft/BashOnWindows/issues/873.
However, Microsoft team actively working on WSL.

I think WSL is future for windows.

I'm closing this issue as no activity for more then 2 weeks. I hope you found a solution (please, share with us).

If you still have any problems feel free to open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

minkbear picture minkbear  Â·  4Comments

lsv picture lsv  Â·  4Comments

osbulbul picture osbulbul  Â·  3Comments

ovaiskhan11 picture ovaiskhan11  Â·  4Comments

krve picture krve  Â·  4Comments