Commit Graph

345 Commits

Author SHA1 Message Date
Vsevolod Fedorov 67645a46eb Fix legacy plugin version comparison; Remove cap on setuptools version
LegacyVersion class is removed from newer setuptools package. But
support for legacy versions is added in python-jenkins 1.8.2.
Switch to that implementation.

Fix broken plugin version comparison for legacy versions.

Assume latest plugin version if no plugin version is found.

Story: 2010990
Story: 2009943
Story: 2009819
Story: 2010842
Task: 49236
Task: 44852
Task: 44396
Task: 48448

Change-Id: Id7f0be1c42357454bd9bedcdee3fefb174943d81
2023-12-19 12:10:43 +03:00
Zuul 5aeecef649 Merge "Update documentation links" 2023-11-23 10:19:08 +00:00
Vsevolod Fedorov a1d4f91d1a Add context for macro calls
Change-Id: I674b153770297c3a0abbfcee26d840e0f2be490b
2023-11-22 12:58:37 +03:00
Vsevolod Fedorov 53bdf1ee7a Update documentation links
Apply URL redirections reported by tox docs-linkcheck output.

Change-Id: Id2f400414068c26d3103ca8fa564b7e9827f9f79
2023-11-09 12:24:34 +03:00
Aleksey Tsalolikhin 940a4b65be fix/2010888 Add default "current-parameters" value in "trigger-builds"
fix/2010888 Add documentation of default value for the "current-parameters" value in the "trigger-builds" builder.

Resolves https://storyboard.openstack.org/#!/story/2010888

Change-Id: Idab9dd0b3cf44b0756019e0e0d3f92f83c0b34b8
2023-08-18 23:04:54 +00:00
Vsevolod Fedorov 6b92807cd7 Tests: Rename yamlparser tests and fixture directories
Rename fixtures directory to job_fixtures to prepare for adding view_fixtures
directory in the following commits.

Change-Id: Ic20997cae020b542ddc22bf444fa6b92fbcae064
2023-01-26 11:06:23 +03:00
Pavel Sedlák c12f334ac7 Add sandbox option to dsl builder
Job DSL plugin supports execution of its groovy DSL code
via sandbox, but until now there was missing option to control it.

Change-Id: I8dccfc608cf59ac46ded712dc937983a22b9d3b3
2022-10-21 01:34:59 +02:00
Eric Ball 930dd24dd2
Fix: Update sphinx version pin, fix warnings
Sphinx was pinned to >1.5.0 <=1.7.0 4 years ago. It is now on v4.4.0,
and we're seeing an incompatibility with the latest version of jinja2.

Along with updating the Sphinx version, this also includes fixes for
several warnings generated in the latest version:
  * Outdated docs due to the removal of the "parser" param from
    Base.get_xml
  * Class lookup issues
  * External links for which we have extlinks defined
  * Deprated PyModulelevel is replaced by PyFunction
  * sphinx.ext.autodoc.Documenter.get_doc signature changed

Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: Iba65fb724f098f3e4a0b20f2a183cb2ea3c450ea
2022-03-31 15:44:40 -07:00
Pat Long d352ed9656 Fix documentation links
Jenkins Wiki has been fully taken off line, so update the remaining
links to reference either the relevant plugin page or the github repo.

Add extlink target for repo in jenkinsci github org.

The sonatype-clm plugin seems to be more-or-less completely deprecated,
so update the description to indicate this and link to the
nexus-artifact-uploader plugin.

Update the jjb sphinx plugin so that it generates references for the
yamlfunctions.

Change-Id: If2241e751d01a60a8cb4cbaea5b3176aeb92eab4
Signed-off-by: Pat Long <pllong@arista.com>
2021-09-09 18:34:40 -04:00
Matthieu Baerts 1d6e580ff3
xunit: support versions 3+
A new major version (3.0.0) of XUnit plugin has been released in January
2021:

  https://github.com/jenkinsci/xunit-plugin/releases/

I didn't have an issue when I upgraded the plugin from version 2.4.0 to
3.0.0. But I started to have this error at the end of a build and I
guess it appeared only after having modified the configuration of the
Jenkins jobs with JJB:

  ERROR: Build step failed with exception
  java.lang.IllegalArgumentException: The tools section is required.
	at org.jenkinsci.plugins.xunit.XUnitProcessor.<init>(XUnitProcessor.java:139)
	at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:204)
	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
	at hudson.model.Build$BuildExecution.post2(Build.java:177)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
	at hudson.model.Run.execute(Run.java:1932)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
  Build step 'Publish xUnit test result report' marked build as failure

When looking at the configuration of the job from the Web UI, the XUnit
plugin was enabled but left "unconfigured": no file to look at.

Apparently, JJB is sending a XML config that is not understood by XUnit
plugin anymore. I guess I didn't have any issue before updating the
Jenkins jobs with JJB because when upgrading XUnit plugin from 2.4.0 to
3.0.0, Jenkins migrated the config to the new format.

From what I see when analysing the generated XML from JJB and the one
from Jenkins after having configured a job manually, a sub-element has
been renamed, from 'types' to 'tools'. I suspect this is caused by this
commit:

  https://github.com/jenkinsci/xunit-plugin/commit/aa47ac57d

(XUnitBuilder class had this line: @XStreamAlias("types"))

So here, I simply picked 'tools' or 'types' for the sub-element and
depending on the plugin's version in both the builder and the publisher
parts. I'm only using the publisher but I guess the problem is the same
with the builder.

Tests have been adapted to verify both versions <3.0.0 and >=3.0.0.

Change-Id: Ie78539d0ae25ddc139ad9982cdffd2e683dd40b2
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
2021-03-17 16:21:33 +01:00
Artem Nikitin 30a73e5301 Fix conditional step issue
If there is the only one macro step in the conditional-step builders
with more than one build steps in the macro, it translated into the
SingleConditionalBuilder Jenkins XML tag, instead of ConditionalBuilder.
It leads to an invalid Jenkins configuration in that case.

Change-Id: Ib9866d93e4ee9fa2823dfb1b5d15870ff56ab9f8
2021-01-18 12:25:30 +03:00
Artem Nikitin 3abe808991 Fix system_groovy issue
System groovy has difference with the simple groovy command. System
groovy result XML for system groovy command (script), looks like this:

    <hudson.plugins.groovy.SystemGroovy plugin="groovy@2.3">
      <source class="hudson.plugins.groovy.StringSystemScriptSource">
        <script plugin="script-security@1.75">
          <script>Groovy command</script>
          <sandbox>[true|false]</sandbox>
          <classpath>
            <entry>
              <url>...</url>
            </entry>
            ...
            <entry>
              <url>...</url>
            </entry>
          </classpath>
        </script>
      </source>
      <bindings>...</bindings>
    </hudson.plugins.groovy.SystemGroovy>

Change-Id: I85eb5848de2a817ab132559b53cbeb316931195f
2020-11-13 15:21:47 +00:00
Thanh Ha 5a98ebb8bb
Fix flake8 BLK100 and BLK999 issues
Resolves flake8 BLK related issues.

"BLK100 Black would make changes."
"BLK999 Unexpected exception: ..."

Change-Id: Ic6d4265e3d02b2f2a15ab851eaed98288c62730c
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-08-31 10:54:19 -04:00
Ben Douglas 6c55bc7821 Gradle plugin: Support parameter passing
Introduce 2 booleans in the Gradle builder section to support passing
parameters by System Properties and Project Properties

Change-Id: I0de1e20b85902263e0d83ccadd64d42fc2b37193
2020-06-01 17:23:57 -04:00
Christian Kanthak d8fa4f4126 Introduce disable-host-key-checking for builder ansible-playbook
Implemented new parameter "disable-host-key-checking" to make the
"anbile-playbook" builder compatible with version >=1.0 of the ansible
plugin. The parameter defaults to "false" for security reasons (as the
plugin does).
The old parameter "host-key-checking" is still written to XML to keep
code working in a setup with plugin version <1.0. This has no impact
on newer setups because the plugin with version >=1.0 ignores the old
parameter value.
For same security reasons the default value of old parameter
"host-key-checking" was changed to "true" to "fix" older setups which
have the parameter not defined.

Change-Id: I4a592c1a4d6ba8bb4f365ce505296cf5c09f7e19
Task: 39789
Story: 2007678
2020-05-15 11:24:34 +02:00
Zuul 9b79893b04 Merge "Add support for become in ansible playbook" 2020-03-04 02:16:25 +00:00
Michal Ovciarik 45f2458584 Add support for become in ansible playbook
Change-Id: Ia116f715042d4a4c8cc26ac45cf1a91be47435d3
2020-02-25 11:18:52 +01:00
Thanh Ha c3ef26c1b0
Ignore py:obj warnings and fail on warnings
* Enables fail on warnings and enable nitpicky
* Consolidate string -> str for args

Change-Id: Id5c29d48813fd6f772816dc74c7c4e408097113d
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 20:43:52 -05:00
Thanh Ha 318ffc7aad
Update Jenkins wiki -> plugins URLs builders
The Jenkins Wiki page is deprecated and Jenkins community is expected
to migrate their documentation to plugins.jenkins.io URL. This patch
updates all builders that have a relevant plugins.jenkins.io URL
documentation link.

Change-Id: Ib07ebb4dceb23325e8d401dd9c0a8dfb9f49cd80
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 17:28:42 -05:00
Thanh Ha 7b00932d2c
Enable docs-linkcheck
This toxenv will allow us to flag URLs that no longer work. We
also switch from using old style setup.py build_sphinx to the
newer sphinx-build command.

Change-Id: I62f42918814fb6eea4876e0d22c6bccddf86a826
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-06 09:50:13 -05:00
Artem Nikitin fa688582a6 Add alias to multijob builder
It's helpful to have possibility to set `jobAlias` in case the
same job is used multiple times with different configurations.

Change-Id: Ic092c6b2f5d893e75ebce4aaebc7eaf88a8978a6
2019-11-13 09:08:38 +03:00
Thanh Ha 4d90c187a9 Auto-generated output from python-black
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>
2019-09-09 19:23:24 +01:00
Zuul b1499530db Merge "Add support for "Build / Publish Docker Image"" 2019-01-02 13:31:54 +00:00
Dane Foster 774dd59f1e adds vault unlocking parameter to ansible builder
This commit adds a parameter to the ansible builder, vault-credentials-id.
This maps to the element <vaultCredentialsId> in the resulting job
definition, and has been tested against the Jenkins Ansible plugin
v1.0.

Change-Id: I40cfd9225923b29c9d2714a60279f1c88f6cb88c
2018-12-13 11:21:19 +13:00
Zuul 3958ed5923 Merge "docker-pull-image: Pull Docker image from Docker Hub/Registry" 2018-11-14 23:52:09 +00:00
Thanh Ha 2854caec9e
Add missing 'release' stage for Nexus IQ
The 'release' phase was missed in the development of this feature.

Change-Id: Ia4660d6b8a86bb43e6ea38802e22c6a5ce06834c
Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-11-07 02:49:46 +08:00
Norbert Grünwald a1dba99eb7 Add 'publish-over-cifs' to the builders module
This adds the 'publish-over-cifs' action to the builders module.
It enables the "Send files to a windows share" build step,
provided by the "Publish Over CIFS Plugin".

Change-Id: I80cb2f86091ef53a284cf85a381294bbb6133010
2018-10-29 15:04:50 +00:00
tanhengyeow b7ee539bc5 docker-pull-image: Pull Docker image from Docker Hub/Registry
Change-Id: I66e638564605fd25504b6e06524a26f778880f06
Co-Authored-By: Anil Belur <askb23@gmail.com>
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-10-29 15:04:37 +00:00
Sorin Sbarnea 539d13e816 Fix flake8 failures and make its execution more consistent
- upgrade flake8 to 3.6.0
- remove use of hacking since pre-commit replaced it
- mentioned minimal flake8 version on pre-commit config
- fixed newer linting errors
- disable W504 as it seems not possible to fix (conflict with W403)
- replaced buggy tox deps installation with native pip install, which
  address the issue of missing to install new deps when the reqs files
  are updated, developer being forced to to recreate the virtualenv.
- prepare for migration from tox-pep8 to tox-linters, now these being
  just aliases.

Change-Id: I310578dce215aaf00a5b2d54716f90da9a1ecb4d
Depends-On: https://review.openstack.org/#/c/613726/
2018-10-28 11:44:43 +00:00
tanhengyeow 039c860dc2
Add support for "Build / Publish Docker Image"
Change-Id: Iac9ffcdcb4312818d53e1da9be92ecdbb84c8cc1
Co-Authored-By: Anil Belur <askb23@gmail.com>
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-09-24 20:16:21 +05:30
Zuul ed468042ba Merge "config-file-provider: Add tests" 2018-09-21 11:38:36 +00:00
tanhengyeow 3c3028f5b8 docker-build-publish: Improve support for new options
Change-Id: I316989cc736bb4ffb6152c68e4b3ff598b4274db
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-09-10 01:57:31 +08:00
tanhengyeow b76d4da653 config-file-provider: Add tests
Change-Id: Id8e36d1745bd05527985d5ee9ddfba32c5fa197d
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-09-07 22:50:46 +08:00
Zuul 8815f8a4a7 Merge "Add new checkboxes for Xcode plugin" 2018-09-06 17:37:27 +00:00
Zuul d374917aae Merge "Add support for "Nexus Repository Manager Publisher"" 2018-09-06 15:26:10 +00:00
Will Soula f475a7fded Add new checkboxes for Xcode plugin
This change allows for the user to specify the following checkboxes:
* Upload Bitcode?
* Upload Symbols?
* Compile Bitcode?

The plugin defaults to these checkboxes being checked, so I kept those
defaults here.

Change-Id: I727611fd2a70f2157b05d030ec296c74a5b214a8
2018-08-28 15:10:57 -06:00
tanhengyeow a345b8372a copyartifact: Add support for new options
New options include:
1. exclude
2. result-var-suffix

This update affects copyartifact in builders.py

Change-Id: I682a10be47f049fe457e5bc199aa50a5583958a7
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-25 20:33:35 +08:00
tanhengyeow 516858a9c4 ant: Refactor code to improve readability
Change-Id: I3d56a18b140e6660c91e144f5bd27db3d8fbded3
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-12 21:53:16 +08:00
tanhengyeow 3cedc7fb63 Add support for "Nexus Repository Manager Publisher"
Change-Id: Icf72b436048bc0364690da2f956ed8b564fa5aa5
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-04 13:17:15 +08:00
tanhengyeow ee86bc318c Add support for "Invoke Nexus Policy Evaluation"
Change-Id: I363e468cdb4b50a0c6cf924d00618fb0ec568588
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-07-26 01:49:33 +08:00
tanhengyeow f9b5016ab7 Refactor builders.py
The refactoring process includes the following
1. Converted all relevant functions to use helpers.<insert function>
instead of a specific import.
2. Standardized indentation for mapping tuple
3. Add commas to last entries of mapping tuples

Change-Id: Ied80c8354b9d59639eba1a3bb9794f19d15c6ba3
2018-07-11 23:12:43 +08:00
Jef Mallal 3841555ab5 Add XUnit processing plugin to builders
Change-Id: Ib51da8d44bd467f9eec76d21a7e6f5014df43209
2018-06-28 15:24:01 +00:00
Zuul 4167c80d3d Merge "Add support for new option in config_file_provider_builder" 2018-06-21 17:35:52 +00:00
Yolande Amate 843929143b Add support for new option in config_file_provider_builder
Change-Id: Iab4ab936a44868abd4e0dbf3033107c0cf33e312
Task: 4669
story: 2001062
2018-05-21 14:18:43 -04:00
Zuul 53d100458d Merge "Add support for aggregated test results" 2018-05-16 09:30:02 +00:00
Will Soula afd7cc8475 Add XCode 9.1 Support
Branched from my xcode-20 branch and rebased from master
and added support for xcode 9.1 now that the xcode plugin has been
released

Due to:
https://issues.jenkins-ci.org/browse/JENKINS-45509

Change-Id: Ibd0f4c82b5e8f37a9da335c57786eae5dc91aefb
2018-05-10 10:27:16 -06:00
Major Hayden 3913c3e71a
Add support for aggregated test results
This patch adds support for aggregated test results in the Jenkins
MultiJobProject plugin.

Change-Id: I5c98f7814d33a740d9a70b584e00d1aa5f50e0ea
Signed-off-by: Major Hayden <major@redhat.com>
2018-04-20 15:49:27 -04:00
Luca Pierri 3264b244b5 fix spelling errors
Change-Id: I42b6bb46a9e5574f88ec5c0cb5726a65353a4fd7
2018-04-16 23:57:41 +02:00
Brett Delle Grazie 2e77650a4e Sonar: Support sonar-scanner tag builder task (master)
Without this, a scanner cannot be selected

Task: 5711
Story: 2001206
Change-Id: I780596ce7f42019132b6c6c2bda9d0fdbd688f32
2018-04-06 11:51:43 +00:00
Yolande Amate 3caff2f7ca Update artifact_resolver to make use of convert_mapping_to_xml()
Update tests for minimal and full types and update docs with default
and required options.

Change-Id: If9aaa35e2d7943b6a49f976db83d9f6cae82005b
Co-Authored-By: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2018-02-28 09:08:39 +00:00