'pre-scm-buildstep' wrapper has two modes:
1. Older: no 'buildsteps' element is specified. Build steps is a list under
wrapper name. For example:
- pre-scm-buildstep:
- shell: echo hello
- shell: echo bye
2. Newer: build steps specified inside 'buildsteps' mapping element:
- pre-scm-buildsteps:
buildsteps:
- shell: echo hello
- shell: echo bye
But, when 'preSCMbuildstep' plugin version is equal or higher 0.3, and first
mode is used, it fails.
Fix that.
Change-Id: I010d9f6c5e06ccd8c2723026aae2c60f79917ff4
Test for timeout plugin version before 1.14.
Test for obtaining timeout plugin version by plugin name "Build Timeout".
Test for nodejs-installator plugin, with nodejs version specified.
Change-Id: I87e304b5b45c957a36ae2a109a176bf70ae94136
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.
Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
For the ssh-user-private-key credential-wrapper, the "key-file-variable"
setting is mandatory, but the "username-variable" and
"passphrase-variable" settings are optional.
Prior to this commit, if a user omitted "username-variable" or
"passphrase-variable" settings, JJB would write empty
<usernameVariable/> or <passphraseVariable/> entries. When both were
empty, the credentials-binding plugin would crash with an error:
IllegalArgumentException("Cannot use the same key in both secretValues and publicValues")
To resolve this, do not write XML entries for these optional parameters
when the user does not specify them.
Add a minimal test case reproducer.
Change-Id: I94a4437eee6a8fdaf655c1a3bf69d46844b225bc
Rename credentials-binding example files to have a dash to correspond to
the YAML key that users will use.
Add the prefix "-full" to indicate that these are full examples where a
user specifies every variable.
Change-Id: Iae52c037b213c8f5511244ba075063e6b1a1f43a
There are cases when you want SSH Agent plugin to just start and stop
an SSH agent during the build, without adding any keys automatically.
One of such cases is when you want to use an SSH key stored on a
SmartCard -like device, such as NitroKey HSM.
So far, when the "users" property was set to an empty list then the
output XML markup didn't contain the <credentialIds/> tag and the plugin
was then crashing with NullPointerException.
Also, when the "users" property was set to a list with just one value
then the output XML markup was always generated in the "old style"
format (matching plugin versions < 1.5, so like almost 8 years old).
With this change, when using the "users" property the markup is
generated based on the actual plugin version installed in Jenkins. More
importantly, the generated markup is now properly handled by the plugin,
no matter if the input is an empty list or a list with one or more
entries.
Finally, fixed the parent of the <ignoreMissing> tag, which was wrongly
put under <credentialIds> tag when generating the "new style" markup
(1.5+), while it should simply be a top-level tag, laying next to
<credentialIds>, as in the corresponding implementation class [1].
This means the "ignore-missing-credentials" property was broken when the
"users" property was set to a list with more than one entry and it's now
fixed.
[1] https://github.com/jenkinsci/ssh-agent-plugin/blob/ssh-agent-1.5/src/main/java/com/cloudbees/jenkins/plugins/sshagent/SSHAgentBuildWrapper.java#L83
Change-Id: Ife5a08739da9ea1130f0ea7daa08c16675f6c75d
This patch adds the following options that are missing from JJB
but available in the UI:
- fail if path not found
- skip ssl verification
- k/v engine version
Change-Id: Id8e14d63c668a1ef826ae88ae3ce0360609bde99
Added the missing tags, also added a test case.
Change-Id: Ic1cb6c3991afe7ef99dd448e6ba49d510f54bd59
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
On version 1.17 of BuildTimeoutWrapper plugin, new option
called "AbortAndRestart" has been introduced. The plugin support
has been updated in order to support this option. A test case
also added.
Change-Id: I4bcbdbc45e177fc4d302baa68898e89463535f6f
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
In the current implementation, jjb creates an empty
combinationFilter tag whenever there is `executionStrategy`.
This empty tag should not appear.
Change-Id: I2bf25ae58d12904ce0a00e0a5cfefbf27d9451ad
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.
Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Preparatory move for adopting pre-commit hooks.
Shoudl only remove newlines and spaces at end of files.
Change-Id: Ia33679467c533722b9308f7e7b74be395c926428
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Adds support for groovy script option and sandbox option.
Updated new example YAML and XML files.
Story: #2000922
Task: #3553
Change-Id: Iad44f9a0a776060c6fb1acfc3ebb44fa3c5acef2
Updates generated config for nodejs
to match current configuration format.
Change-Id: Ie2642cc81d7dcf176c3d826120850dfaa1811150
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
If, for whatever reason, the version of the build-timeout
plugin can not be detected, assume that we use a newer version (>= 1.14).
Version 1.14 is already ~ 2 1/2 years old so this is a sane assumption.
Also adjust fixtures to use the newer plugin version xml output.
Change-Id: I86295933d0c3247f55d0114473fc9c8f8feb7441
Signed-off-by: Bertrand Roussel <broussel@sierrawireless.com>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
prefix-variable is currently not available for use in the version-number wrapper.
updated wrapper for support of this variable
and updated test fixtures to also use this variable.
set default value of prefix-variable to ''
Errors out without a default value set saying the attribute is missing,
and since this is an optional attribute we don't want that.
Task: 4885
Change-Id: I151eef271194fb38dfde7518698f2ff06e3a8f01
Ensure separate pattern tag is created for each pattern to be added.
This ensures that failure to add a pattern to the yaml will not trigger
an exception either.
Story: 2001109
Change-Id: I77f2b467e1f9b37817f5d516744abac8475a71ef
- Added failOnError argument for pre-scm-buildstep
- Introduced buildsteps argument and moved list of build steps to match xml configuration of the preSCMbuildstep plugin.
- Updated existing test cases to match the new argument structure
- Added test case for pre-scm-buildstep to verify creation of failOnError tag
- Added verification on version to maintain retro-compatibility
- Updated documentation to fetch example from testcase definition
Change-Id: I25c19cd0552cf2de97b9c391492d95779c1360be
Task: 3163
Story: 2000690