vs-deploy icon indicating copy to clipboard operation
vs-deploy copied to clipboard

Can pull/download all files from target?

Open ghost opened this issue 7 years ago • 18 comments

Hey there, it's a great tool for deploy work. I'm not sure if I missed something. I configured an FTP deploy and found that only files both on local and target will be pulled or deployed. Just want to know if I can pull/download all files from the target which are not on local. Any help will be appreciated. Thanks!

ghost avatar May 17 '17 11:05 ghost

@hushedmo

No, only files that are part of your package (or current files / folders) will be handled.

Otherwise you should extend your list of glob patterns in your package definitions.

mkloubert avatar May 17 '17 15:05 mkloubert

@mkloubert Thanks for the explanations. You mean I can use files to extend the list? I tried to add settings:

"files": [
    "**/*.+(php|js|css)"
 ],

But didn't get what I want. For example, there is a file index.php on the remote. There is NO such file on the local. Can I download the file index.php to local from remote with pull method?

ghost avatar May 18 '17 05:05 ghost

No, because the glob patterns only work for local files.

Currently I have no chance to use them on the remote side.

mkloubert avatar May 18 '17 08:05 mkloubert

@mkloubert Thanks for your explanations. May I suggest a new download feature? This can download all files from remote to local, as sometimes we may need to fetch all files to local first. Then the pull method does the current work (only download files on the list). Appreciate your great work!

ghost avatar May 18 '17 13:05 ghost

When can we expect this enhancement? @mkloubert

rajeshshou avatar Jun 10 '17 11:06 rajeshshou

@hushedmo @rajeshshou

I will try to implement the feature within the next week.

mkloubert avatar Jun 10 '17 12:06 mkloubert

Oh great! Thanks for such a quick reply. @mkloubert

rajeshshou avatar Jun 10 '17 14:06 rajeshshou

Also can we have this when some one opens a file,it is synced with remote file automatically in background?

rajeshshou avatar Jun 10 '17 15:06 rajeshshou

@rajeshshou

I released a new version 9.20.1 that is now able to sync files when opening them in editor:

Demo sync when open

What you have to do, is to setup your package(s) like that:

{
    "deploy": {
        "packages": [
            {
                "name": "My PHP files",

                "files": [
                    "/**/*.php"
                ],

                "syncWhenOpen": "My SFTP server"
            }
        ],

        "targets": [        
            {
                "name": "My SFTP server",
                "type": "sftp",

                // ...
            }
        ]
    }
}

mkloubert avatar Jun 10 '17 21:06 mkloubert

@mkloubert Thanks for this amazing feature!

ghost avatar Jun 10 '17 22:06 ghost

"deploy": {
        "packages": [{
            "name": "Projects",
            "files": [
                "**/chart-converter/**",
                "**/frontend/**",
                "**/options-components/**"
            ],
            "exclude": [
                "**/node_modules",
                "**/node_modules/**",
                "**/bower_components",
                "**/bower_components/**",
                "**/dist",
                "**/dist/**",
                "**/deploy.zip",
                "**/img",
                "**/img/**",
                "**/.git",
                "**/.git/**",
                "**/sftp-config.json",
                "**/sftp-settings.json",
                "**/i18n",
                "**/i18n/**",
                "**/sync.ffs_db"
            ],
            "deployOnSave": true,
            "syncWhenOpen": true,
            "targets": [
                "Remote PA3 folders"
            ],
            "fastCheckOnSave": true
        }],
        "fastCheckForIgnores": true,
        "targets": [{
            "type": "sftp",
            "name": "Remote PA3 folders",
            "dir": "/home/user/rshou/projects/",
            "host": "myhost",
            "port": 22,
            "user": "myusername",
            "password": "mypassword",
            "checkBeforeDeploy": true
        }]
    }```

Is there anything wrong?
As sync on open did not work for me !

rajeshshou avatar Jun 10 '17 23:06 rajeshshou

Can't we always sync down when opening the file if deployonsave or deployonchange feature is used? as server files can be updated either by save in which case server and local file would be same or by file changing on remote in that case server file would be newer.

Also if the file does not exist on server then it should be deleted on local if opened or atleast should be asked to whether to delete or not.

rajeshshou avatar Jun 10 '17 23:06 rajeshshou

@rajeshshou

Oh, sorry ... I forgot to implement minimatch support.

Update to version 9.22.0 and add fastCheckOnSync to your package:

"deploy":
{
    "packages": [{
        "name": "Projects",
            
        // ...

        "fastCheckOnSync": true
    }]
}

mkloubert avatar Jun 11 '17 00:06 mkloubert

@rajeshshou

I released version 9.23.0 with a new setting, called alwaysSyncIfNewer:

"deploy":
{
    "packages": [{
        "name": "Projects",
            
        // ...

        "alwaysSyncIfNewer": true
    }]
}

This will always download the file when opening it and if it is newer on the remote side.

I think that it is the better way to set up this explicitly, especially if you work with SCMs like git.

mkloubert avatar Jun 11 '17 02:06 mkloubert

@mkloubert Perfect! That's great. Also it would be better if I could see the output logs when I open a file because that way i would know the file has finished syncing as sometimes it has a delay in syncing.

Just waiting for the last enhancement where you can download non-local files as well. You are really great man ! Let me know if I can help in anyway.

rajeshshou avatar Jun 11 '17 08:06 rajeshshou

Log release was awesome !!! @mkloubert

rajeshshou avatar Jun 12 '17 19:06 rajeshshou

@mkloubert Is this available ? I can see a new release. If yes, how do I use the updateModeOfDirectories if that is related?

rajeshshou avatar Jun 18 '17 18:06 rajeshshou

@rajeshshou

Unfortunately I still need some days to implement the feature with a new major release.

I currently work in the v10 branch and do only bugfixes and some small enhancements that are related to these fixes for v9.

I have currently implemented this feature for local and sftp targets.

I will release the new version 10.0.0 the time I have implemented this for the other supported targets.

Currently I work on an explorer feature that is brought with the new API of VSCode 1.13.

aufnahme_2017_06_19_00_19_15_738

The positive side effect is, that I can check if the feature works reliable.

BTW: The new updateModeOfDirectories has something to do with setting modes via chmod on a SFTP server.

mkloubert avatar Jun 18 '17 22:06 mkloubert