appleboy / drone-ssh

Drone plugin for executing remote ssh commands
MIT License
239 stars 73 forks source link

chore: flexible configuration of environment value transfer #235

Closed Iam1337 closed 1 year ago

Iam1337 commented 1 year ago

Hi! I propose an example of implementing a more flexible setting for passing environment variables.

Reason: I have to use drone-ssh to work with Windows SSH. Initially, drone-ssh is written so that it transmits environment variables through the export command. Which makes it unsuitable for working with Power Shell.

Solution: I have added a new option to configure environment variable commands formatting, with default value: export {NAME}={VALUE}. When I use drone-ssh with PowerShell I set this option like this: $env:{NAME} = {VALUE}.

Important! I don't know Go, so my Pull Request is more of a Proof Of Concept and request of feature. I'm sure it can be done better.

appleboy commented 1 year ago

I will take it.

appleboy commented 1 year ago

@Iam1337 Thanks for your contribution. I will fix the unit testing and bump the next version.