| Q | A
| ----------------- | ---
| Issue Type | Question
| Deployer Version | 6.0.0
| Local Machine OS | Windows 10
| Remote Machine OS | Ubuntu 16.04
Hi,
I'm trying to use deployer for the first time, but I'm facing some problems. I didn't find my answer on other issues/forums.
I required deployer/deployer with composer. Then, I go to /vendor/bin folder and "dep init". So, the deploy.php is in the bin folder. Is it normal ?
Then I'm trying the 'dep deploy' command, but I have this error :
The command "export SYMFONY_ENV='prod'; echo $0" failed.
Exit Code: -1 (Unknown error)
'ssh' is not recognized as an internal or external command ...
I know the SSH error is not due to Deployer, but I don't understand how to do it on windows ?
The "command ... export ... failed" error is it related with the SSH one ?
Thanks a lot :)
deploy.phpnamespace Deployer;
require 'recipe/symfony3.php';
// Project name
set('application', 'backoffice');
// Project repository
set('repository', '[email protected]:my-project.git');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
add('shared_files', []);
add('shared_dirs', []);
// Writable dirs by web server
add('writable_dirs', []);
set('allow_anonymous_stats', false);
set('ssh_multiplexing', false);
// Hosts
host('vps486717', 'xx.xx.xx.xx')
->user('root')
->identityFile('~/.ssh/id_rsa')
->set('deploy_path', '/var/www/resa');
// Tasks
task('build', function () {
run('cd {{release_path}} && build');
});
deployer uses ssh to actually connect to the server. The error message means, that you have not installed it. There is a windows version of SSH on sourceforge: https://sourceforge.net/projects/sshwindows/
The problem is, with newer deployer versions the ssh command will again fail: The binary linked above is from 2004 (!) and there seems to be no newer version available (correct me on this if possible), and deployer uses one of the newer features of ssh.
What you can do (and how I am using it) is using the Ubuntu shell you can install via the windows store: https://www.microsoft.com/store/productId/9NBLGGH4MSV6
This will give a new shell (called "Bash on Ubuntu for Windows"). Use this whenever you're using deployer (you can find your drives in the directory /mnt/c/...).
You can check whether your ssh connection now works by executing ssh [email protected]. As soon as you get this to work, you can use deployer to do the deploying for you.
I tried it a long time after my question ... but it works ! Thanks a lot @famoser :)
I have to specify my passphrase both, after deploy:prepare and deploy:update_code. Is it normal ?
Thanks again :)
I'll always use rsa keys to authenticate, that way I do not need to type in any passwords anymore. Here's how it works, use the Ubuntu shell or similar:
cat ~/.ssh/id_rsa.pub to ensure you already have created an rsa ssh key for yourself, if none ("No such file or directory"):ssh-keygen -t rsa -b 4096 -C "[email protected]" to generate a new keyeval $(ssh-agent -s) to start the ssh agentssh-add ~/.ssh/id_rsa to add the key to your ssh agentssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] (the last time you'll need to your password)ssh [email protected] to verify all went wellThis kind of got off topic, if you feel comfortable (and indeed can do so, not sure who is allowed to do this), consider closing the issue.
I'm sorry, my message wasn't clear ... :)
It's my private key passphrase that I need to repeat both.
Thanks :)
Closing this issue as inactive. If you still have this problem, please open a new issue.
Most helpful comment
deployer uses
sshto actually connect to the server. The error message means, that you have not installed it. There is a windows version of SSH on sourceforge: https://sourceforge.net/projects/sshwindows/The problem is, with newer deployer versions the
sshcommand will again fail: The binary linked above is from 2004 (!) and there seems to be no newer version available (correct me on this if possible), and deployer uses one of the newer features ofssh.What you can do (and how I am using it) is using the Ubuntu shell you can install via the windows store: https://www.microsoft.com/store/productId/9NBLGGH4MSV6
This will give a new shell (called "Bash on Ubuntu for Windows"). Use this whenever you're using deployer (you can find your drives in the directory /mnt/c/...).
You can check whether your
sshconnection now works by executingssh [email protected]. As soon as you get this to work, you can use deployer to do the deploying for you.