14 Commits

Author SHA1 Message Date
James E. Blair
d82139fe28 Remove buildWrappers from base xml.
It's in a module now.

Change-Id: I96ef714cfb96b8085580bae284250a0c94fef1a5
2012-06-21 11:12:20 -07:00
James E. Blair
a15c433bc8 Abate modules section.
This is the first in a series of changes to alter the way modules
are handled.

This change removes the module section from yaml.  Instead, all files in
modules/ are imported, and a 'register' function is called if it exists.

The register function can add (any number of) module classes to a module
registry.  The registry will also keep track of helper functions for use
by other modules, and the register function can add those.

This sets up the ability for a module other than the 'builders' module to
register builders.  Eventually, we should be able to move all OpenStack
specific builders, publishers, etc outside of the base modules; instead
we would just register an 'openstack_pep8' builder in a module of our own
that the job filler would know to invoke.

The API for modules is slightly changed, adding a root_xml method to handle
the different project types, a handle_data method for modules that want
to modify the yaml data structure before any XML is generated, and a data
parameter is added to the generate_xml method.  Ideally, we will migrate
those modules that count on having a centrally stored data object to using
the one passed into this method to allow maximum flexibility.  I also
envision some project-level yaml attributes to be moved closer to the
handlers that use them.

This change does inadvertently alter the XML produced.  Here is the result
of test.sh:  http://paste.openstack.org/show/18585/

In all cases, those are inconsistencies in the YAML that are corrected
by this change.  Some jobs included an empty triggers vector (due to
module trigger_none) while others did not, so there was no way to satisfy
both behaviors.  The added postbuilder section in the gerrit maven job is
there because the job specified postbuilders, but did not include the
postbuilder module.  I believe the resulting XML is more desirable.

Change-Id: Ib38222e6bfc9d5b55aa497669d7023c7aaf4b7bc
2012-06-18 17:33:47 -07:00
James E. Blair
1ea656b6a4 Changes to builders/publishers.
Make the following changes to builders and publishers in service
of being able to handle this job:

  http://paste.openstack.org/show/18541/

* Allow builders to have attributes
* Add a generic shell script builder
* Make the 'project' job attribute optional
  (no link to github will be made in that case)
* Combine all separate publishers into one publisher module
  so that jobs may have more than one publisher
* Name the section that lists publishers "post_build_actions"
  to be consistent with the web UI
* Allow publishers to have attributes
* Add an archive artifacts publisher
* Add a parameterized build trigger publisher
* Add a parameterized build_trigger builder
* Add wrappers
* Add a build timeout wrapper
* Add a timstamp wrapper

Also, make the following small improvements:

* The 'disabled' attribute of a job is optional, defaults to false.
* Add a script to verify XML output is the same before and after
  a change to the job filler (test.sh)

Change-Id: Icf2228494e431f5bf0a5f051f63842f12f6f92f1
2012-06-14 18:09:26 -07:00
Monty Taylor
018bb1c288 Add support for maven jobs.
Add a project module type with some special case rules so that
the general case does not have to add one to its yaml files.

Change-Id: Id110e79c34fa3982275f549d017adb03a1faf473
2012-05-30 15:06:44 -04:00
James E. Blair
e72a409538 Add Zuul jobs.
Change-Id: Ib9b0bfcb843713e5df441fbd8c0f0ba7d58e07ae
2012-05-30 00:42:37 +00:00
Andrew Hutchings
7b13362dc9 Fix name off-by-one
Job names were off-by-one

Change-Id: I0f3a9936b543189ca073e4559084f400eeae2a1a
2012-05-27 16:34:01 +01:00
Andrew Hutchings
db188312f8 Fix YAML parsing
* When not using template don't skip the first job (fixes bug #1004575)
* Allow multiple templates or a mix of templates and single jobs in a project
YAML

Change-Id: I2dffa75c3fde2e7061886ffd879958933a150798
2012-05-25 18:10:46 +01:00
Andrew Hutchings
aae2f80fdd Make all Python pass pyflakes
This found one bug, but will also help us with Jenkins testing of these scripts

Change-Id: Iabe171645c06f769957db7cf0def1d10a0e47988
2012-05-25 14:26:41 +01:00
James E. Blair
3c660d675e Support dependent changes in gerrit-git-prep.
Also added full hostname support to gerrit-git-prep -- 'review.openstack.org'
instead of 'openstack'.  This means it can be used with 'review-dev.openstack.org'
for instance.

Updated the jenkins job filler to use a 'review_site' parameter to facilitate that.

Updated the jenknis jobs filler to use slightly different variables
  review_site
  github_org
  publisher_site
which are more explicit about their purpose than 'site' and 'host'.

Make the docs/tarball publishers require a site param.

Change-Id: If24be8f7a74c09b215f94d371d5f09a695e2c098
2012-05-24 16:45:46 +00:00
Andrew Hutchings
0a9ab137f4 Fix is_job call
is_job is a local method

Change-Id: Ibef717ee5b8b3465dac185dc0cb5bb4f895bad29
2012-05-22 19:53:22 +01:00
Monty Taylor
7f53875e7f Port job_filler to python-jenkins.
Change-Id: I151582412267414097bb411d0ab81e03247fc0a2
2012-05-19 12:00:19 -04:00
Andrew Hutchings
8a7a1ab6d0 Jenkins Job Builder 2.2
Adds support for project templates
Fixes a dep issue in Ubuntu
Switch off debug print in jenkins_talker.py
Fix pep8-check job
Remove dep on PyXML
Remove pretty printing (probably not needed anyway)

Change-Id: Id14d65674b7ab080df566fa31f2d4d5f88986e9d
2012-05-16 17:04:15 +01:00
Andrew Hutchings
5599a3daa8 Version 2.1 of Jenkins Jobs Builder
* Adds delete support
* Adds check-* job support

Change-Id: Ia7a19cebd32cb348e26b086353a8b5225e1e5837
2012-05-14 20:33:56 +01:00
Andrew Hutchings
c3db5b210a Jenkins Job builder 2.0
This uses a python script with modules for parts of the XML.  The parameters for the projects are provided using YAML scripts.

It also includes a Jenkins API module to directly inject jobs into Jenkins without requiring a restart/reload as well as a memory of which jobs have been pushed to Jenkins.

It is currently configured to replace the original Jenkins Jobs in StackForge.

What it won't yet do:
1. Delete jobs (although it isn't far off being able to)
2. check-* jobs (need to modify the trigger_gerrit module to support that)

Documentation to follow

Fixes bug #995599

Change-Id: I2a67ee2d9e8f43cbced56425ef7f80dc6a30a814
2012-05-11 14:43:52 +01:00