| Q | A |
| --- | --- |
| Issue Type | Feature Request |
| Deployer Version | master |
| Local Machine OS | OSX 10.11.4 |
| Remote Machine OS | Debian 6.0.7 |
Is there a way for the download function to handle directories ?
In addition to my deployment tasks, I also created two tasks in order to sync the markdown files the users created with my deployed CMS.
pages:upload works perfectly, but pages:download does not at all.
deploy.php<?php
require 'recipe/composer.php';
require 'vendor/deployphp/recipes/recipes/rsync.php';
/*
|--------------------------------------------------------------------------
| Server and services
|--------------------------------------------------------------------------
*/
server('prod', 'domain.com', 22)
->user('me')
->password('****')
->stage('production')
->env('deploy_path', '/path/to/domain/');
set('repository', 'my@server:repository.git');
set('shared_dirs', [
'user/pages',
'logs',
]);
set('writable_dirs', [
'cache',
'logs',
'images',
'user/pages',
]);
/*
|--------------------------------------------------------------------------
| Tasks
|--------------------------------------------------------------------------
*/
task('pages:upload', function () {
upload('user/pages', '{{deploy_path}}/shared/user/pages');
});
task('pages:download', function () {
download('user/pages', '{{deploy_path}}/shared/user/pages');
});
$ ./bin/dep pages:download production -vvv master ✱ ◼
➤ Executing task pages:download
↳ on [prod]
PHP Warning: fopen(user/pages): failed to open stream: Is a directory in /Users/loranger/Developer/myproject/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php on line 2054
Warning: fopen(user/pages): failed to open stream: Is a directory in /Users/loranger/Developer/myproject/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php on line 2054
[RuntimeException]
Why not using rsync recipe? https://github.com/deployphp/recipes/blob/master/docs/rsync.md
I did consider (that's the reason why the require remains on top of the file) but there is no way to call a task from another :
task('pages:download', function () {
env('rsync_src', '{{deploy_path}}/shared/user/pages');
env('rsync_dest','user/pages');
call_task('rsync');
});
Yes. no nested calls. It's against deployer way. If you need it. Simple separate it to function.
Yes, that's an explanation I often read in the issues.
Anyway, what about my initial request ?
What do you think about making download function working seamless with files and folders, as the upload function does ?
rsync?
Sure, I get it, Rsync is an excellent recipe to remote sync anything.
But I do talk about two low-level methods shipped with depoyer: download and its opposite, upload.
They are supposed to do the same thing, but one for down stream and one for up stream.
Their signature are the same, but one can deal with folder when the other cannot.
That's why I opened this issue : May you consider to make those two functions more consistent ?
+1 for that.
I think the API should be consistent.
More to that, rsync is not easy to run on windows systems. I can manage everything else with just git bash, but rsync is not included.
@elfet, so this would not work without rsync?
It can be implemented. But now easiest and fastest way to use rsync.
@elfet Do you plan to implement it in the future? Writing this to make sure it gets (hopefully) into the roadmap or gets rejected totally and I have no hope for it((
If i have time for it - definitely. But not in v4 release. Now looking for some sponsor for Deployer, can't do it for free any more.
What about something like https://www.indiegogo.com/. I can't be a full time sponsor, but sharing a bit is within my abilities. Would be happy to promote this, but a good roadmap is surely needed to get funds.
Recently created page at https://www.patreon.com/deployer
Cool. But I still would recommend posting a nice roadmap there. And allow patrons who give more influence roadmap features. I would be glad to promote this, but would rather do it after you'll polish your proposal.
I will write nice roadmap definitely.
Hello @antonmedv! Could this feature be put on the roadmap?
It is important for me because I want to use deployer not only for deploying, but also for setting up a local dev environment from the git repo and some shared folders on the live server. So I just clone the git repo and run something like dep download_assets. I will also dump and download the remote db, but that is possible now.
@ivangretsky this is already implemented in Deployer 5 ;)
Cool!
Where could I follow this type of updates?
By the way, is 5 anywhere near being production ready? I did try it yesterday on Windows with no luck.
Where could I follow this type of updates?
mater branch, docs.
By the way, is 5 anywhere near being production ready?
I hope so :) Need to find some time.
@ivangretsky
Hi.
Recently I wrote simple task that synchronizes directories between servers with rsync.
May be it will be useful for you
Most helpful comment
Sure, I get it, Rsync is an excellent recipe to remote sync anything.
But I do talk about two low-level methods shipped with depoyer:
downloadand its opposite,upload.They are supposed to do the same thing, but one for down stream and one for up stream.
Their signature are the same, but one can deal with folder when the other cannot.
That's why I opened this issue : May you consider to make those two functions more consistent ?