vscode-sftp icon indicating copy to clipboard operation
vscode-sftp copied to clipboard

Upload local files to multiple servers at once.

Open xiaobanni opened this issue 2 years ago • 5 comments

This is a similar request as #127, but I'm trying to make it as clear as possible.

{
    "name": "xxx",
    "protocol": "sftp",
    "port": 22,
    "username": "xxx",
    "remotePath": "xxx",
    "privateKeyPath": "xxx/id_rsa",
    "profiles": {
        "xxx1": {
            "host": "xxx1"},
        "xxx2": {
            "host": "xxx2"},
        "xxx3": {
            "host": "xxx3"}
    },
    "defaultProfile": "xxx2"
}

Configure "defaultProfile": "xxx2" to select a specific server to be uploaded, and then perform the operation Ctrl+Shift+P + SFTP: Sync Local -> Remote.

I think the following features are valuable, for example:

Set "defaultProfile": ["xxx1", "xxx2", "xxx3"] and then perform the same operation Ctrl+Shift+P + SFTP: Sync Local -> Remote, we can upload local files to all the servers "xxx1", "xxx2" and "xxx3" at once.

xiaobanni avatar Sep 06 '22 12:09 xiaobanni

This sound interesting. I could use that it our workflow... So +1 ;-)

jjnxpct avatar Sep 24 '22 11:09 jjnxpct

Related issues : #125, #127, #156, #277

Natizyskunk avatar Sep 26 '22 23:09 Natizyskunk

Should be fixed in new v1.16.2 release.

Natizyskunk avatar Jun 16 '23 01:06 Natizyskunk

Should be fixed in new v1.16.2 release.

Hi @Natizyskunk , First of all, thank you for the amazing extension! I upgraded to v1.16.3 and multiple profiles seem to be not working properly for auto uploads. I have "uploadOnSave": true but when I save a file, it is only synced to the default/set host. Is this the desired behavior? If so, would it be possible to add an option to config to mimic the SFTP: Upload the active file to all profiles for uploadOnSave?

Below is my sftp.json:

  {
    "name": "Generic",
    "username": "USERNAME",
    "protocol": "sftp",
    "port": 22,
    "uploadOnSave": true,
    "ignoreFile": ".gitignore",
    "ignore": [
      ".vscode",
      ".git"
    ],
    "profiles": {
        "HOST1": {
          "host": "HOST1",
          "remotePath": "HOST1PATH",
          "uploadOnSave": true,
          "privateKeyPath": "HOST1_KEY_PATH"
          
        },
        "HOST2": {
          "host": "HOST2",
          "uploadOnSave": true,
          "remotePath": "HOST2PATH",
          "privateKeyPath": "HOST2_KEY_PATH"
        }
    }
  }

gsaltintas avatar Jun 16 '23 13:06 gsaltintas

Having the option to upload on save to two servers would be great.

sickerin avatar Jan 31 '24 03:01 sickerin