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
Fix job-specific parameters for job groups.

When a job template is instantiated via a job-group,
job-specific parameters provided by the project are not
respected.

The correction is just a matter of updating correctly the
dictionary containing all parameters.

The configuration below exhibits the issue:

- project:
    name: project-with-specific-parameters
    jobs:
        - my-job-group:
            recipients: "foo@example.com"

- job-group:
    name: my-job-group
    jobs:
        - job-sending-notification-mails

- job-template:
    name: job-sending-notification-mails
    publishers:
      - email-ext:
          # {recipients} should be available.
          recipients: "{recipients}"
          subject: Subject for Build ${{BUILD_NUMBER}}


Change-Id: I107d8d648c8965cd125db52f3558f28337c25a63
Reviewed-on: https://review.openstack.org/33190
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
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
setup.py: Basic support for windows.

During setup, some commands (git describe mainly) are launched,
and fail under Windows since /bin/sh is not available.

By switching to cmd to execute commands when python says that
the os is 'nt', setup.py works under both Linux and Windows.

I have used that patch for some time now, and haven't found other
issues yet.

Change-Id: Ib4c0ec53765ae80fc6b63c34a926644427a9ebce
Reviewed-on: https://review.openstack.org/33368
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
job filtering was not working properly

When passing job names as arguments to 'update', the command is supposed
to only retain this jobs.  Due to the job being a dict, the filter would
never match and the none of the job would be updated.

This has apparently always been broken since the feature got introduced
in 85cf7a41.  Using job.['name'] fix it up.

Change-Id: Icf4d5b0bb68777f7faff91ade04451d4c8501c6a
Reviewed-on: https://review.openstack.org/34197
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
add Environment File Plugin

This commit adds the Environment File Plugin to JJB.
https://wiki.jenkins-ci.org/display/JENKINS/Envfile+Plugin

Change-Id: Id35a4d6ab25b0440303da02bb91007b459979243
Reviewed-on: https://review.openstack.org/35170
Reviewed-by: Arnaud Fabre <fabre.arnaud@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
Add TAP test result handling ability

Add support for using org.tap4j.plugin.TapPublisher as a publisher "tap"

See https://wiki.jenkins-ci.org/display/JENKINS/TAP+Plugin for the
plugin in question

Change-Id: Iddbd96715830ecc761384963fecfe3cd5ec3c115
Reviewed-on: https://review.openstack.org/34974
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
Metadata plugin module - largely based on Parameters module.

I implemented this plugin as I use Jenkins Metadata plugin heavily in all my
projects instead of the default Parameters plugin and think that everyone else
would benefit from this addition to JJB as well.
Current implementation handles dates in epoch format only and does not handle
'node' element - so no metatree creation is possible.

Change-Id: I1e67224df9339f1319a371d049585c8343301f2e
Reviewed-on: https://review.openstack.org/33773
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
trigger_parameterized_builds: Add support restrict-matrix-project.

When triggering a downstream matrix job, it can be useful to
restrict runs to a subset of all combinations. This is done
by a groovy filter, configured with the restrict-matrix-project
key.

Change-Id: I6ac252657e35c110f1caa48b59e970ed390935e5
Reviewed-on: https://review.openstack.org/35063
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Add support for job priority sorter plugin.

This plugin provides a way to configure priority of jobs in
build queue. Each job has a inherent, configurable, priority.
Builds of higher priority are scheduled first.

Change-Id: Ie7f374369a141bec094bf9a6a7438082bf298fb5
Reviewed-on: https://review.openstack.org/35064
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins