76 Commits

Author SHA1 Message Date
Antoine Musso
ab434cc288 Revert "Allow using template variables in "defaults" field."
This reverts commit 70ed22362a9c13ea9f3165e5747dcca281ad439c.

I knew I should have tested the patch with my own templates. Doing so I
discovered a nasty regression:

The defaults can make use of variables passed by the project. By moving
applyDEfaults to be called after deep_format is performed on job
templates, any substitutioncontained withing defaults is no longer
correctly replaced by project parameters.

Change-Id: I69ffb3e28093af6db62962786d9275bf3ba4e115
2014-07-24 15:54:07 +00:00
Jenkins
e1ddd23483 Merge "Allow using template variables in "defaults" field." 2014-07-07 10:11:26 +00:00
Joao Vale
70ed22362a Allow using template variables in "defaults" field.
Change-Id: I876ab7fa61258e84b00a67325aeb9234aff8fa62
2014-06-27 18:09:20 +01:00
Jenkins
09729852f9 Merge "removed job configuration duplication in docs" 2014-06-27 12:11:21 +00:00
Jenkins
015f084bee Merge "Fix a broken include in the configuration documentation." 2014-06-25 17:56:38 +00:00
Darragh Bailey
3e3996d32a Use yaml local tags to support including files
Add support for local tags which are application specific to allow
including of other yaml files or code from scripts. Allows for code to
be maintained and tested as seperate files, as well as reduces
duplication of yaml code that cannot be macro'ed or easily templated by
including it from a common file.

Adds support for the following tags:
  'include' - load file as yaml code
  'include-raw' - load file as data (for scripts)
  'include-raw-escaped' - load file as data with escaping braces '{}'
      as default for use with job-templates

Use configuration file options to provide a search path for the files.

- Test behaviour of yaml tags independent of any XML generation
  by comparing json result of yaml parsing to verify that certain
  tags do/don't recall the yaml.load() method.
- Add examples for the include tags via addition tests for YamlParser
  class

Inspired by
http://stackoverflow.com/questions/528281/how-can-i-include-an-yaml-file-inside-another

Change-Id: Ib90a07043112d4739d6529ceddbc9817668bcec0
2014-06-20 23:16:23 +01:00
Florian Preinstorfer
7cab474680 Fix a broken include in the configuration documentation.
Change-Id: I803caea42365e44851068e510d5e698447aad73b
2014-06-18 11:55:08 +02:00
Jenkins
416ee7dcd3 Merge "re-arrange docs for clarity" 2014-06-12 01:52:19 +00:00
Jenkins
0691cfa1d2 Merge "remove misleading jjb example" 2014-06-11 19:24:01 +00:00
Jenkins
de43eaddf7 Merge "Support variable-specific substitutions in templates." 2014-06-11 09:27:37 +00:00
zaro0508
b38c5e46ac re-arrange docs for clarity
The info on using list and dict as parameters seemed a little too advanced
to be in the description of 'templates'.  This change moves this example into
a newly created 'advanced' configuration section.

Change-Id: I98b80233c45ac721819360743dcae5e82c63ecbf
2014-06-06 09:55:47 -07:00
Khai Do
2d1494d3a3 remove misleading jjb example
Change I059f38d0aa8a8947aaac75e0ddb34d392063ece3 added support for
passing parameters to jobs in groups but not for variable substitution
on those parameters. Substitution on job list parameters would
be a new feature. This change removes a misleading parameter subsitution
example.

Partial-bug: #1298568
Change-Id: I18e28bb622f0473f049963ce6dcf6c4efd11dc2c
2014-06-06 09:30:17 -07:00
Khai Do
d96d351868 removed job configuration duplication in docs
The same job definition and examples were in both general.rst and
configuration.rst.  Moved the contents of general to configuration.

Change-Id: Iefdf1b6ac3b9679a8af4451710442bf58054d790
2014-06-05 11:16:01 -07:00
Jenkins
f61b654c85 Merge "update URL references to project." 2014-06-04 09:50:51 +00:00
Marc Abramowitz
b33ac74828 Add tox "coverage" target
Change-Id: I577d62e016a550ea30671837a0a426165984e982
2014-05-27 16:50:34 -07:00
Khai Do
6eb31208fb update URL references to project.
github.com/openstack-ci was moved to github.com/openstack-infra
homepage references should point to git.o.o/cgit/openstack-infra

This change updates the above references accordingly.

Change-Id: I4d3591f228b10de050a129ae7af99485f50edab5
2014-05-22 11:23:17 -07:00
Joao Vale
2de0e0e7df Support variable-specific substitutions in templates.
Change-Id: I6af84f48eaa4ee44c8d8babddd8d10a1e1095101
2014-05-12 15:03:10 +00:00
Darragh Bailey
07c5bd1cc3 Test creation of multiple jobs from templates
Concatenate each job XML created from the parsed yaml when using the
YamlParser class for testing. Ensures that multiple jobs created from a
single yaml file can be tested.

Remove erroneous multiple job from scm_remote_deep_bug test.

Change-Id: I2732a7303fefff1f321a1a5b7eef9144d168e39a
2014-05-10 22:21:06 +01:00
Jenkins
90af7a8fc6 Merge "Added config options to not overwrite jobs desc" 2014-04-21 18:12:34 +00:00
Marc Abramowitz
14ed8b12d0 test command read/write stdin/stdout by default
E.g.:

    jenkins-jobs test < config/jenkins.yml

This is convenient for demoing or implementing functional tests.

Change-Id: I4e3030e261d3b90f75e4a033ea074d18764d97bf
2014-04-18 14:55:40 -07:00
Jenkins
8d74c20240 Merge "add ability to parse from a file object" 2014-04-14 18:30:54 +00:00
Alexandre Conrad
a6194c582e add ability to parse from a file object
Change-Id: I4f62fad4d2c0e361eddaed6d4db2faa655bd4b11
2014-04-13 18:31:37 -04:00
David Caro
4206928c1d Added config options to not overwrite jobs desc
When you do not specify any description for a job, right now it creates a
new one overwriting whatever you had put there manually. Now when
setting the configuration option 'keep_descriptions' to True, it will
only overwrite the description if you specified one explicitly in the
yaml.
That way you can avoid specifying any description and it will not
overwrite the ones you put there manually through the jenkins ui.

Added a couple of tests for it also, and extended the tests to allow custom
configuration by adding a *.conf file for it

Change-Id: I408f5ee06a6939a8cb8f4f2e6c6e0d060462259c
Signed-off-by: David Caro <dcaroest@redhat.com>
2014-04-09 23:29:14 +01:00
David Pursehouse
dd36e35476 Minor fixes in the installation documentation
Fix a couple of grammatical errors, and wrap long lines to fit
within 80 columns.

Change-Id: Ide46f5fdc6bb2f0b759fc6e69669097d23149791
2014-04-08 11:06:22 +09:00
Jenkins
55382baf5e Merge "Small documentation tweaks" 2014-04-07 19:52:25 +00:00
Marc Abramowitz
8fa82635bd Small documentation tweaks
Change-Id: I00ed518141b60dfa1c22a11edc391532bf49a0a1
2014-04-04 06:52:21 -07:00
Jenkins
3ddbf020e0 Merge "use {obj:key} as a way to pass an object and not only strings to templates" 2014-04-04 10:51:44 +00:00
Vitaliy Lotorev
c9c784aecc add retry-count in general.py
implement retry-coutn in general.py;
update doc and add test fixtures

Change-Id: Ifeb4fb645ad0e4bc12d41ef4481aca1888a4041a
2014-03-28 00:41:22 +04:00
Victor Seva
673454debd use {obj:key} as a way to pass an object and not only strings to templates
As mentioned at the mail list[0]:

"So I need another way how to pass a *list* as data structure from
the defaults/project down to the job-template definition, similar to
what can be done with "{variable}" for strings."

[0] http://lists.openstack.org/pipermail/openstack-infra/2014-February/000799.html

Closes-Bug: 1281038
Change-Id: I5b04ddb52e537fedd2d05795e91011afd92f2295
2014-03-16 15:30:48 +01:00
Antoine Musso
5f96ad465b Use venv to build documentation
The Sphinx documentation now make use of the `program-output` plugin
which would invoke commands to generate inline documentation. Ex:

    program-output:: zuul --help
    program-output:: zuul enqueue --help

We want the resulting output to correspond to Zuul source code, not the
command which is currently installed on the host running the doc.  On my
setup sphinx would die out because it cant find the command 'zuul'.

The new tox environement 'doc' runs sphinx in a virtual env which will
have the proper zuul command.

The generated doc is not written under the /.tox directory but to
/doc/build/html for convenience.

Example usage:

    tox -edoc && open doc/build/html/index.html

Change-Id: Ib0170f94bb2c09eb60e555a32e101e2e0959b18e
2014-03-02 10:56:40 +01:00
Jaroslav Henner
841550ecbd Enhance project specific parameters example.
It was not clear that the project-specific parameters are actually a variables.
Improving the example to make it more clear.

Change-Id: I919562d4df53542ff0d4d60cf0fafc81b69aff1a
2014-02-06 21:41:33 +01:00
Guido Günther
e5faf0637c Explain howto use maven's pre/postbuilders
They're configured like the other builders but one needed to check the
source to verify this until now.

Change-Id: I97400ad9c7cb0dfb89fe2757c4bedce639e7ea24
2014-01-10 19:07:16 +01:00
Jenkins
7959bf44db Merge "Enable ignore_cache flag on jenkins_jobs.ini" 2013-12-12 04:41:11 +00:00
Felipe Reyes
f24987718b Fix format in installation.rst
There was a line throwing a Warning due a badly formatted bullet point

Change-Id: Ia8b70fadfb66c4d0c10631ef4bf37f01d38b9f02
2013-12-11 16:31:05 -03:00
Yolanda Robla
b123c13e99 Enable ignore_cache flag on jenkins_jobs.ini
Parses jenkins_jobs.ini to look for an ignore_cache flag.
If ignore_cache command line option is sent, it takes priority
over the jenkins_jobs.ini configuration.

Change-Id: I88f1ce1aa0d3e0ad25d592d3ca44a022ec9249c3
Closes-Bug: #1193444
2013-12-10 12:59:13 +01:00
Jenkins
4ac4b88e5a Merge "update doc and add new JJB unit tests" 2013-11-22 19:03:00 +00:00
Khai Do
b790bbc681 update doc and add new JJB unit tests
Add documentation on how to generate documentation and run JJB unit tests.

Also added a unit tests for each category of plugins as examples for others
to follow when adding new JJB plugins.  I'm hoping this will help contributors
add tests for new plugins going forward.

Change-Id: I2ab90cdb37d0f3b1e947345d4291d2927b04a0c6
2013-11-22 17:51:17 +00:00
Khai Do
ab0ab40076 fix jjb configuration documentation
fixed incorrect yaml indentation in the project template and macro section

Change-Id: I9f284dcc39c9c428595c10f4c1bc5e97081392c3
2013-11-19 19:29:30 +00:00
Benjamin Staffin
67cfe4ad0d Add display-name job property.
There is apparently no way to clear this property using the REST api
once it is set, and the included documentation change warns of that.

Change-Id: I49c5a91664cd37196f3239854bb0adbcf5b3c9f9
2013-11-05 19:04:54 -08:00
DennyZhang
7530955593 fix typo
Change-Id: Ie8d6e35094a1bd0c970c8122b0a76bca1fba4f7f
2013-10-31 13:33:09 -05:00
Pierre Rognant
822ecab7d0 Flow project support
The approach is pretty straigh forward, it consists of one new
module handling the project-type "flow". It supports the only field
needed by this kind of project an XML block containing the flow
description in a custom DSL.

Change-Id: I5195391609b3058ae9e24a59024e0cc7a69b16a0
Implements: blueprint jenkins-job-builder-flow
2013-10-04 14:30:02 -04:00
Antoine Musso
f1c02f85e1 doc: fix up strict errors
Running Sphinx 1.2b1 running in strict mode (-W), yields three different
errors:

* .. Running::   is an unknown command, uses '.. rubric::' instead
* double stars '**' needs either to be escaped with backslashes or
  quoted literrally with double backquotes
* nested lists needs newlines before and after for some reason.

Change-Id: I8680aef7306c619c817c637882715f5a7d08c5d9
2013-09-28 17:56:32 +02:00
Jenkins
0c730c33cf Merge "Add documentation for XDG_CACHE_HOME" 2013-09-09 22:17:46 +00:00
Jenkins
b4c9a54a26 Merge "Add usage info to JJB documentation" 2013-09-09 22:16:51 +00:00
Khai Do
d18c3cb1f5 Add usage info to JJB documentation
Display the usage info for JJB and add it to the
sphinx docs.

Fixes bug 1221944

Change-Id: I5b36cca7a836b009bfb0ca880abbccd4477de307
2013-09-09 15:14:18 -07:00
Khai Do
73df0ac7a7 Add documentation for XDG_CACHE_HOME
This patch documents the XDG_CACHE_HOME environment variable in JJB.

Fixes bug 1193450

Change-Id: I57cf59c8723aa04e20801f32a81b573c9d096b48
2013-09-09 13:48:28 -07:00
Mathieu Gagné
444b053f6a Job-specific subst. in a job group's job list
Adding job-specific substitutions in a job group's job list
would result in JJB crashing with the following error:
  TypeError: unhashable type: 'dict'

This change adds the ability to add job-specific substitutions
in a job group's job list. It implements the same logic used by
a previous change (6ff1d69).

Change-Id: I059f38d0aa8a8947aaac75e0ddb34d392063ece3
2013-08-20 19:03:18 -04:00
Jeremy Stanley
ca509654c3 Document escaping braces in template literals
* doc/source/configuration.rst: In a literal string within a
template, deep_format will interpret braces as delimiting an
expansion parameter unless doubled up. Document this.

Change-Id: I703f03f89436a09d64b79b147bec6441e1f8cc38
Closes-Bug: #1210293
2013-08-13 03:30:46 +00:00
zaro0508
c494239b48 document JJB module execution order
Jenkins executes the JJB modules in a specific order.
It helps users to understand the order when creating
jenkins jobs.

Change-Id: I134ccf927cb387a0d112a8bedb446fe96196eb84
2013-07-17 21:16:22 -07:00
Roman Revyakin
51b736b2dd 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
2013-07-08 19:17:27 +00:00