[RELENG-2812] Add jenkins-cli support for current and next version. Draft for feedback #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds functionality to support different versions Jenkins in TryLib.
To issue remote commands, the jenkins-cli version must match the server version. Each version requires different options.
In version, 2.303.1 both protocol and authentication options come into play.
Currently, the jenkins-cli jar path is specified as an argument to JenkinRunner instances without taking into account the server version. Likewise, the options to the cli command were fixed and do not match the 2.3 version requirements.
The JenkinsCli class provides methods for getting server info and for building cli commands that take into account the version-specific options.
It is assumed tar the jars to be used have been deployed to /ust/etsy with the following convention:
jenkins-cli.jar : the default version in production
jenkins-cli-2.303.1.jar : a specific version is given as part of the name, in this case for jenkins 2.303.1
It is assumed for now that we are going to use the ssh protocol.
try-next is an example of how to use the JenkinsCli class.