Commit Graph

33 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
Thanh Ha 620f032ce0
Update Jenkins wiki -> plugins URLs
The Jenkins Wiki page is deprecated and Jenkins community is expected
to migrate their documentation to plugins.jenkins.io URL. This patch
updates links that have a relevant plugins.jenkins.io URL
documentation link.

Change-Id: I7ce6978d48d09deea976e9b5f800632e92e7bd11
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 18:23:28 -05: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
Thanh Ha 97d2e1f7b6
[Maven] Update helpers import to common style
Change-Id: Iccf83252663426fc0859025928d4ff9e6acfff3c
Signed-off-by: Thanh Ha <zxiiro@linux.com>
2018-07-23 23:21:44 -04:00
Andrea Scarpino dff7df4ef0 Maven project: allow to disable trigger downstream projects
Change-Id: Ie4af949ad686f007d3091d947ef65c670262f8d4
2018-02-27 17:57:12 +00:00
Dong Ma fda76531d9 Remove the colon after default in docstring
This commit change the '(default: ...)' docstrings to '(default ...)',
also change 'Default' to 'default', to make docstring consistent.

Change-Id: Ib7957000013b0664f40eb74efad6f1c7359675fa
2016-06-17 02:19:13 +08:00
Darragh Bailey bafc09598f Compatibility support for older maven project plugins
Enable testing of project modules to receive plugin info and ensure
that versions of the Maven project plugin older than 2.0.1 continue to
receive the required XML setting.

Change-Id: I2669052d0ef31c0b766e9cde24c842136c172b6c
2016-05-03 18:45:49 +01:00
Nicolas Glayre 832a99b6e1 Removing perModuleEmail paramater management
In the maven-plugin, its usage is deprecated since version
2.0.1 and later (back in october 2013), causing errors on
/administrativeMonitor/OldData/manage webpage.
Before deprecation, default value was already true. To support
the plugin before it was deprecated the best would be to have
it parametrizable

Change-Id: Ic049e961983e9d5b25c5a2b0d32be5b3f717e923
2016-04-23 16:11:47 +01:00
Jenkins e9542dae92 Merge "Convert remaining Jenkins wiki URLs to sphinx roles" 2016-04-22 15:46:59 +00:00
Darragh Bailey f0ec23e200 Convert remaining Jenkins wiki URLs to sphinx roles
Some remaining full URL usage has slipped in, convert these to use the
jenkins-wiki role extension for consistency through documentation.

Change-Id: I128c4838e846a3354a3e2961c244d5d45c2ee868
2016-04-22 15:12:25 +01:00
Thanh Ha 5cdbb719af
Fix CFP configuration for >=2.10.0
In CFP plugin version >=2.10.0 the JJB code completely breaks for Maven
settings due to the new support for freeform cfp id names. We can detect
a old style name simply by reading the starting of the name and setting
it to set settings_type=cfp to maintain support for the old versions of
this plugin. Otherwise the default settings_type will fall back to 'file'.

Users using cfp will now need to set 'settings-type: cfp' in their YAML
files if they need to pull in CFP settings. All other settings file
configuration will work as it did in the past.

Change-Id: I650d485de6ecc1d2ef8fad6580c0c315fadde168
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2016-04-22 09:08:59 -04:00
Darragh Bailey 8805a34c0f Reorder imports to match hacking guidelines
Ensure that the imports follow the standard OpenStack hacking
guidelines.

Change-Id: Iaa4326aef118ddfd807dd006934f1d9ca80a1cfa
2015-12-23 15:23:42 -08:00
Somay Jain 25a507ff8f Support for post-step-run-condition in Maven projects
Change-Id: I87e1b58ad69330f3bb44070513ac90ec03b65cb4
2015-06-27 21:03:46 +05:30
Somay Jain d09f6d5ec0 Improvements in the Maven Plugin.
Adding the ability to configure the following checkboxes -
* Incremental build - only build changed modules
* Disable automatic site documentation artifact archiving
* Disable automatic fingerprinting of consumed and produced artifacts
* Build modules in parallel
* Resolve Dependencies during Pom parsing
* Run Headless
* Process plugins during pom parsing
* Use custom workspace

Change-Id: Ie379e8812175a5b2dcb68546520994e9ce04d66a
2015-05-26 00:58:13 +05:30
Thanh Ha df2337bf9b
Consolidate CFP settings into a common function
ConfigFileProvider configuration is the same but is used in a few
places. This patch consolidates the configuration into a common reusable
function.

Change-Id: Idb45e43ff5a9dd6cea84e37026f875f98dc04c83
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2015-03-03 16:08:51 -05:00
Thanh Ha 26c79aa9f5
Add support for Config File Provider to Maven Project module
Note: this is a port of the patch from commit 1e216835
https://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git;a=commit;h=1e216835

This patch adds some detection logic to the code to detect if the
settings file starts with:
    org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig
or in the case of global-settings starts with:
    org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig

If true, the module will configure for Config File Provider as the
settings files.

See:
https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin

Change-Id: Ic7f4d4d676e67f5f96afc3bd412dea5a50bee79b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2015-03-03 16:01:23 -05:00
Thanh Ha 1e21683521 Add support for Config File Provider to Maven Project module
This patch adds some detection logic to the code to detect if the
settings file starts with:
    org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig
or in the case of global-settings starts with:
    org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig

If true, the module will configure for Config File Provider as the
settings files.

See:
https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin

Change-Id: Iecadfd6265100720d1d0b08d3cf57a510999f89d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2014-11-22 17:38:29 -05:00
David Pursehouse 731615c9f9 Consistency updates in documentation
Change-Id: I0096348488371c37c0ba645f0bd3d385975ef7d2
2014-06-20 11:41:40 +09:00
Andrew Grimberg 9b32e0fbad Allow custom settings configs for maven projects
Allow custom settings & global-settings config files to be configured
for maven projects.

In addition, the previously defined empty nodes for these configurations
were misnamed and this corrects that as well.

This change also switches to using an included test as an example.

Change-Id: I9f832f498e358268b3896ead3a78462e408bdd9d
Signed-off-by: Andrew Grimberg <grimbeaj@gmail.com>
2014-04-02 16:51:03 -07:00
Guido Günther 04052d8769 project_maven: allow to set private repository
The values map to these GUI choices

 * default            -> Default
 * local-to-executor  -> Local to the executor
 * local-to-workspace -> Local to the workspace

This is on the project level what the similar option is on the builder
level.

Change-Id: I90ee3385ee12a46b5ab1eb26e3af1bdbfc36946a
2014-01-27 23:32:50 +01:00
Guido Günther 828e134c7e project_maven: Don't require artifact-id and group-id
Jenkins will determine the values from the pom automatically so there's
no need to require them.

Change-Id: Ic1c9c26a05e335fd78a92fe4316ecc88b3f209b9
2014-01-23 08:38:52 +01:00
Khai Do b47fe61905 make job creation consistent
Defining a project (in yaml) without setting any other parameters should
generate a basic jenkins job (in xml).  While this works for freestyle jobs,
jjb will throw an error for maven and flow projects.  The behavior should be
consistent across all types of projects.  This patch just makes it so
that the behavior is consistent.

Change-Id: If7b749dae7631e8714a9416dfbd82d2443c0302c
2014-01-22 15:21:14 -08:00
Arnaud Fabre 627b87f13d Use a more consistent style for booleans values.
For an optional boolean option, a common idiom was to write:
  data.get('option-name', 'false')

Using a keyword False instead of the string 'false' (resp. True
instead of 'true') is deemed clearer, since it conveys that the
option is a flag.

Such calls are modified to using False/True. The change has been
creating using `git grep '.\(false\|true\).)'` to find what needed
to change.

Change-Id: I54087b5487c7186fcc4ee70ea9b28c1a1002a547
2013-08-10 00:51:15 +02:00
Arnaud Fabre 79d7d5e64b Maven: expose configuration of automatic archiving.
By default, Maven projects are configured to automatically
archive maven artifacts.

This commit exposes an option to configure that behavior in
a backward compatible way. By default, automatic archiving
is active, which means writing false in the XML configuration,
since the element name is "archivingDisabled".

Change-Id: I35e8a035a53356d7c171735aa5a52c6c429d1608
Reviewed-on: https://review.openstack.org/33367
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-06-19 21:32:01 +00:00
Antoine Musso 42a016bc03 maven: support for MAVEN_OPTS
The maven build phase offers us a way to pass additional parameters to
the JVM.  The option is shown as MAVEN_OPTS and accept a string which is
then expanded as mavenOpts.

Change-Id: I0a2437e8bda1e828c09e87343f7ca5025b77182c
Reviewed-on: https://review.openstack.org/32965
Reviewed-by: Arnaud Fabre <fabre.arnaud@gmail.com>
Reviewed-by: Mathieu Gagné <mgagne@iweb.com>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2013-06-19 15:53:42 +00:00
Mathieu Gagné bea3701cc5 Allow to override ignore upstream changes setting
When ignore-upstream-changes is set to false, it will configure
the job to build whenever a SNAPSHOT dependency is built.

This setting is only available to Maven projects.

The default value is still 'true' for backward compatibility.

Change-Id: Ibdcdeef6264a68b9002a5b5bb35b90233db67e8a
Reviewed-on: https://review.openstack.org/32298
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-06-11 23:19:15 +00:00
Arnaud Fabre 54b6bcc44d Maven: Fix XML markup.
The generated markup contains a node "root_module", which is not
recognized by Jenkins:

  WARNING: Skipping a non-existent field root_module
  com.thoughtworks.xstream.converters.reflection.MissingFieldException: No
  field 'root_module' found in class 'hudson.maven.MavenModuleSet'

The correct spelling is rootModule.

Change-Id: I0cae2c3358f2664783c97e245b064453a05bc988
Reviewed-on: https://review.openstack.org/26052
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2013-04-05 20:06:33 +00:00
Clark Boylan ff734c72dc Add ability to specify mavenName for maven jobs.
Previously maven jobs did not specify a maven name so which maven
install Jenkins treated as default was used for all JJB maven jobs. Add
the ability to set a maven install explicitly so that multiple maven
installs may be used.

Change-Id: I6a26635c31c5504b855063e1d4f6fa53132f26b5
Reviewed-on: https://review.openstack.org/19756
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-01-16 00:11:41 +00:00
James E. Blair ab7c6bc6c1 Add documentation.
Move test.sh to the tools directory.
Move parameters and notifications to their own modules; even
though they are implemented as Jenkins properties, they make
more sense as separate entities in the job builder, because
that's they way they are specified in the YAML.  All three
modules that touch the properties xml object know how to
create it if it's missing.

Change-Id: I4b42ff10a93fd3ed98f632b58e47f3e0e45086d6
Reviewed-on: https://review.openstack.org/12741
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-09-17 20:25:38 +00:00
James E. Blair c3cc3c9c08 Add rootpom option to maven jobs.
Change-Id: I3a865cdc1ae9f92c39033e7b31b490ff7c384b95
Reviewed-on: https://review.openstack.org/11924
Reviewed-by: linuxjedi <andrew@linuxjedi.co.uk>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-08-24 16:28:06 +00:00
James E. Blair fb0a113eff Add tox.ini and pep8, pyflakes cleanup.
Change-Id: I4d6312e92dffd596ae58e55c837e3db3ea7d1c52
Reviewed-on: https://review.openstack.org/11198
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-08-15 00:26:28 +00:00
James E. Blair 6a5392603e Change all '_' to '-' in YAML for consistency.
Change-Id: If19cb26fa544b485acfc188baf3506eaea61d6cf
Reviewed-on: https://review.openstack.org/11154
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-08-10 18:41:21 +00:00
James E. Blair 8f09841693 Refactor modules and templating.
Switch to using entry points for loading modules as well as
individual buliders, triggers, publishers, etc.

Remove most openstack-specific python code.

Change templating so it's less repetitive -- a single project
definition will suffice for multiple jobs or job-groups.

This outputs XML that is identical to the current production XML,
warts and all.  There are significant improvements that can be made
to the YAML in a separate change, as they will cause minor changes
to existing jobs (adding timestamps, logrotate, etc.).  These are
mostly marked with TODO in this change.

Change-Id: Idcfddb3b43b6cfef4b20919a84540706d7a0a0b1
Reviewed-on: https://review.openstack.org/11000
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-08-10 16:00:42 +00:00