azure-vm-agents-plugin
azure-vm-agents-plugin copied to clipboard
Support init scripts from GitHub repositories
What feature do you want to see added?
Currently, it's possible to specify an init script via the Jenkins UI (or CasC). This works fine but it would be good if users could specify an init script from a GitHub repository as well. This is especially useful when the same init script is used outside of Jenkins to configure other VMs.
To give an example, we have an init script that is used to install tools on CI/CD agents (Jenkins, GitHub, Azure DevOps etc.). This init script is consumed by Azure VMs (Linux and Windows) using the CustomScript extension. In the CustomScript extension it's possible to use a GitHub repostiory as the fileUris.
My understanding of the current plugin is that it takes the init script from the UI, saves it to Azure blob storage and then uses this value as the fileUris in the CustomScript extension settings. If a user specifies a init script from a GitHub repository, the plugin could use this value as the fileUris instead. Alternatively, it could download the init script from GitHub and upload it to Azure blob storage. It can then be consumed via the CustomScript extension.
I think the later approach would be better as it could support private repositories as well (which require authentication). If using an init script from a private repository, users could specify a Jenkins credential to use via the UI. The plugin could then use this credential to authenticate against GitHub and store the init script in Azure blob storage.
Upstream changes
No response
Are you interested in contributing this feature?
Happy to contribute to user testing and potentially development (depending how complex the changes are).
Sounds reasonable, somewhat related to https://github.com/jenkinsci/azure-vm-agents-plugin/issues/252