Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Upgrade rsync's version #274

Open
odarino opened this issue Sep 8, 2020 · 2 comments
Open

Upgrade rsync's version #274

odarino opened this issue Sep 8, 2020 · 2 comments

Comments

@odarino
Copy link

odarino commented Sep 8, 2020

@gregberge Hi Greg.
AFAIK current version of rsync that Shipit using is 2.x.x. But the minimum version of rsync on Windows is 3.x.x (which it causes some errors I face just now). It will be nice if you can upgrade version of rsync on Shipit, so Windows users can use it properly. Thanks a lot : )

@obriankevin11
Copy link

What are the errors you were facing? I have problems running shipit on windows, it tries to delete a file using rm command....

@Firer
Copy link

Firer commented Dec 28, 2020

I was also having problems using shipt to deploy from Windows due to rsync. The cwRsync (free version) https://chocolatey.org/packages/rsync isn't able to interpret Windows drive paths. I have created a monkey patch for it in my shipitfile.js as below:

  shipit.blTask('fix-rsync-windows', () => {
    shipit.pool.connections.forEach(connection => {
      const { runLocally } = connection;

      connection.runLocally = (cmd, options) => {
        if(cmd.startsWith('rsync')) {
          cmd = cmd.replaceAll(/([A-Z]):\\/g, (_, driveLetter) => `/cygdrive/${driveLetter.toLowerCase()}/`);
          cmd = cmd.replaceAll('\\', '/');
        }
        return runLocally.call(connection, cmd, options);
      }
    });
  });

  shipit.on('deploy', () => {
    return shipit.start(['fix-rsync-windows']);
  });

This now gets local paths resolving correctly. I then had problems with rsync trying to use a Unix style home directory, and being unhappy with the ssh private key permissions with errors such as:

Could not create directory '/home/<redacted>/.ssh'.
Host key verification failed.

and:

Permissions 0770 for '/cygdrive/c/Users/<redacted>/.ssh/id_ed25519' are too open.
It is required that your private key files are NOT accessible by others.

These were fixed with help from the solutions at:
https://stackoverflow.com/questions/54508759/ssh-from-rsync-on-windows
https://superuser.com/questions/1296024/windows-ssh-permissions-for-private-key-are-too-open

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants