-
-
Notifications
You must be signed in to change notification settings - Fork 79
Support execution on Windows by using ssh-agent provided by git #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Since Windows-10 a ssh-agent is installed by default on Windows systems. But that agent works differently than the ssh-agent known from UNIX systems and therefore attempts to use this plugin fail. From the error message the cause of the failure is not easy to understand. And of course not being able to use this plugin on Windows agents is in general a unsatisfactory situation. Fortunately the git (for-windows) installation by default contains a ssh-agent implementation that behaves like the known UNIX implementation and runs on Windows. And a git installation is often available. This change extends the ssh-agent plugin to attempt to locate the described ssh-agent installation provided by git, when running on Windows. If no executable is found, either through a git installation or by searching the system's PATH variable, the execution fails with a meaningful message.
|
Another alternative or complementary solution could be adding a configuration option with the ssh-agent executable. |
|
@jglick could you please have a look at this respectively the remaks? |
|
Sorry, I am not maintaining this plugin save for critical fixes or routine org-wide maintenance. It works on Linux but was never intended for use on Windows, and is best avoided generally. #163 (comment) |
Too bad :/ Is there anybody else maintaining this too and interested in reviewing this?
Understand, still I think it would be convenient if this would work on Windows too, especially in multi-OS pipelines where similar scripts run under multiple OS. Mainly because this plugin makes the use of SSH very convenient and simple.
Or would you be willing to accept at least a change to just add the proposed |
I do not think so. I will mark it for adoption. (See #153.) |
Too bad :/
Thanks for the pointer, I looked into this but I'm struggling to use the approach using |
|
On Windows? No. For most purposes in CI systems you would not need to use |
Since Windows-10 a ssh-agent is installed by default on Windows systems. But that agent works differently than the ssh-agent known from UNIX systems and therefore attempts to use this plugin fail. From the error message the cause of the failure is not easy to understand. And of course not being able to use this plugin on Windows agents is in general a unsatisfactory situation.
Fortunately the git (for-windows) installation by default contains a ssh-agent implementation that behaves like the known UNIX implementation and runs on Windows. And a git installation is often available.
This change extends the ssh-agent plugin to attempt to locate the described ssh-agent installation provided by git, when running on Windows.
If no executable is found, either through a git installation or by searching the system's PATH variable, the execution fails with a meaningful message.
If you don't want a strict requirement on
git-clientI could also make that optional and prepare the code to handle a potential absence at runtime.This hopefully avoids confusion like in
Testing done
I tested this locally with the changes applied on a Windows computer and it worked out of the box.
If you think there should be more test cases I'm happy to provide them, but I'd need some instructions and specific demands.
I see that you execute the build pipeline (including tests?) on Windows too, but from my understanding of the problem, this plugin effectively doesn't work on Windows at all (before this change). So either the latter assumption is wrong or the tests cover scenarios.
Submitter checklist