jenkinsci / mac-plugin

Plugin to configure Macs as Jenkins agents
https://plugins.jenkins.io/mac/
MIT License
12 stars 12 forks source link

Support for copying file from Jenkins host to agents #27

Open jonkipu opened 2 years ago

jonkipu commented 2 years ago

This change adds a config option for the host to allow selecting Jenkins File Credentials items to be uploaded to a path relative to the agent's User home folder, this was useful to me in some cases where I was using tools requiring specific config files including password / tokens etc (.npmrc, .aws config, ssh config)

Pretty similar to #15 but I needed it to be more generic

Unsure to write tests for such a feature since I'm pretty new to Jenkins plugins, would love some guidance in this area

mat1e commented 2 years ago

Hi @jonkipu, the code looks clean thank you. Please add somes tests, especially for the new method uploadHostFile. I will try your feature and let you know.

jonkipu commented 2 years ago

Thanks I will try to add some tests, also I want to fix a possible security issue with the path resolving to make sure you can't "escape" the home folder. Will update you when I'm done