diff -Nru jenkins-job-builder-0.8.0/AUTHORS jenkins-job-builder-0.8.1/AUTHORS --- jenkins-job-builder-0.8.0/AUTHORS 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/AUTHORS 2014-06-12 04:49:29.000000000 +0000 @@ -1 +1,87 @@ - +Alexander Braverman +Alexandre Conrad +Andrew Grimberg +Andrew Hutchings +Antoine Musso +Arnaud Fabre +Attila Fazekas +Benjamin Staffin +Bhuvan Arumugam +Bill Maxwell +Brad P. Crochet +Carl Fürstenberg +Clark Boylan +Darragh Bailey +Darragh Bailey +David Caro +David Johansen +David Pursehouse +DennyZhang +Doug Hellmann +Dzmitry Horbach +Eli Klein +Emilien Macchi +Eric Erfanian +Fathi Boudra +Felipe Reyes +Florian Preinstorfer +Gabriele Cerami +Ghe Rivero +Guido Günther +James E. Blair +James E. Blair +Jaroslav Henner +Jason Kincl +Javier Martinez Canillas +Jeremy Stanley +Joao Vale +Johannes Erdfelt +Jon-Paul Sullivan +Julian Taylor +Julien Danjou +K Jonathan Harker +Kei YAMAZAKI +Khai Do +Kiall Mac Innes +Leif Madsen +Lukas Bednar +Manuel Desbonnet +Marc Abramowitz +Marcus Nilsson +Mark Holmquist +Martin Konrad +Mathew Odden +Mathieu Gagné +Max Rydahl Andersen +Mayeul d'Avezac +Mehdi Abaakouk +Michael Prokop +Monty Taylor +Morgan Fainberg +Ondra Machacek +Patrik Boström +Paul Belanger +Pavel Sedlák +Peter Jönsson +Peter Liljenberg +Philippe Godin +Pierre Rognant +Randy Coulman +Roman Revyakin +Sergey Kolekonov +Shane Wang +Sylvain Baubeau +Takeshi Kanemoto +Timo Tijhof +Tollef Fog Heen +Tollef Fog Heen +Victor Boivie +Victor Seva +Vitaliy Lotorev +Will Soula +Yolanda Robla +desbonne +pierre +unicell +william.soula +zaro0508 diff -Nru jenkins-job-builder-0.8.0/ChangeLog jenkins-job-builder-0.8.1/ChangeLog --- jenkins-job-builder-0.8.0/ChangeLog 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/ChangeLog 2014-06-12 04:49:29.000000000 +0000 @@ -1,11 +1,27 @@ CHANGES ======= +0.8.1 +----- + +* re-arrange docs for clarity +* remove misleading jjb example +* matrix project: add support for dynamic axis +* ssh publisher: add always-publish-from-master support +* authorization property: add extended read support +* reference tests as examples +* Add tox "coverage" target +* scms: MultiSCM is generated for scms hidden in macro +* update URL references to project +* add overview info to pypi + 0.8.0 ----- * Fix typo: sigleton => singleton +* Support variable-specific substitutions in templates * Add support for triggering on unreviewed patches +* Test creation of multiple jobs from templates * Refactor the `matches` function * Modularize to enable easier testing * Checkstyle publisher did not honor 0 values @@ -23,6 +39,7 @@ * add support for python builder * Catch EPIPE exception and return * Update authorship information +* Fail if specified set of defaults is not found * add timeout-var option to the timeout module * Added support for Exclusion plugin * Add support for multiple Gerrit servers in Gerrit trigger diff -Nru jenkins-job-builder-0.8.0/debian/changelog jenkins-job-builder-0.8.1/debian/changelog --- jenkins-job-builder-0.8.0/debian/changelog 2014-06-02 05:32:57.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/changelog 2014-06-15 16:20:39.000000000 +0000 @@ -1,3 +1,17 @@ +jenkins-job-builder (0.8.1-0.1) unstable; urgency=medium + + * Non-maintainer upload. + * New upstream release. + * debian/patches: + - drop authorization-property-add-extended-read-support.patch - merged + - drop general-add-support-for-childCustomWorkspace.patch - merged + - drop matrix-project-add-support-for-dynamic-axis.patch - merged + - add 0002-general-add-support-for-childCustomWorkspace.patch + - add 0005-builders-add-publish-over-ssh-support-as-a-build-ste.patch + * debian/control: bump python-pbr build-dependency to 0.8.2 + + -- Fathi Boudra Sun, 15 Jun 2014 19:16:53 +0300 + jenkins-job-builder (0.8.0-0.1) unstable; urgency=medium * Non-maintainer upload. @@ -6,7 +20,7 @@ - drop Fix-doc-error-in-the-testng-publisher.patch - add authorization-property-add-extended-read-support.patch - add general-add-support-for-childCustomWorkspace.patch - - add matrix-project-add-support-for-dynamic-axis.patch + - add matrix-project-add-support-for-dynamic-axis.patch * debian/control: add python-pbr build-dependency. * debian/rules: export PBR_VERSION to workaround ftbfs caused by pbr. diff -Nru jenkins-job-builder-0.8.0/debian/control jenkins-job-builder-0.8.1/debian/control --- jenkins-job-builder-0.8.0/debian/control 2014-05-24 15:05:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/control 2014-06-15 16:21:35.000000000 +0000 @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 9), python-all (>= 2.6.6-3), python-jenkins, - python-pbr, + python-pbr (>= 0.8.2), python-setuptools, python-sphinx (>= 1.0.7+dfsg), python-sphinxcontrib-programoutput, diff -Nru jenkins-job-builder-0.8.0/debian/patches/0002-general-add-support-for-childCustomWorkspace.patch jenkins-job-builder-0.8.1/debian/patches/0002-general-add-support-for-childCustomWorkspace.patch --- jenkins-job-builder-0.8.0/debian/patches/0002-general-add-support-for-childCustomWorkspace.patch 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/0002-general-add-support-for-childCustomWorkspace.patch 2014-06-15 16:11:33.000000000 +0000 @@ -0,0 +1,123 @@ +From 5b83b7f35ab405dbaed30ae2421968a11e4f99eb Mon Sep 17 00:00:00 2001 +From: Fathi Boudra +Date: Sun, 1 Jun 2014 19:12:05 +0300 +Subject: [PATCH] general: add support for childCustomWorkspace + +On freestyle project, we can set custom workspace. +On matrix project, we can set custom workspace and child custom workspace. + +It allows to specify the directory for sub-builds. + +Change-Id: Icef3831174ff805e86f1ece84fef9a438f465691 +Signed-off-by: Fathi Boudra +--- + doc/source/configuration.rst | 5 +++++ + doc/source/general.rst | 5 +++++ + jenkins_jobs/modules/general.py | 3 +++ + tests/general/fixtures/custom-workspace001.xml | 10 ++++++++++ + tests/general/fixtures/custom-workspace001.yaml | 2 ++ + tests/general/fixtures/custom-workspace002.xml | 16 ++++++++++++++++ + tests/general/fixtures/custom-workspace002.yaml | 3 +++ + 7 files changed, 44 insertions(+) + create mode 100644 tests/general/fixtures/custom-workspace001.xml + create mode 100644 tests/general/fixtures/custom-workspace001.yaml + create mode 100644 tests/general/fixtures/custom-workspace002.xml + create mode 100644 tests/general/fixtures/custom-workspace002.yaml + +--- a/doc/source/configuration.rst ++++ b/doc/source/configuration.rst +@@ -38,6 +38,7 @@ later. There are a few basic optional f + concurrent: true + quiet-period: 5 + workspace: /srv/build-area/job-name ++ child-workspace: /srv/build-area/job-name + block-downstream: false + block-upstream: false + +@@ -76,6 +77,10 @@ later. There are a few basic optional f + Path for a custom workspace. Defaults to Jenkins default + configuration. + ++**child-workspace** ++ Path for a child custom workspace. Defaults to Jenkins default ++ configuration. ++ + **block-downstream** + Boolean value to set whether or not this job must block while + downstream jobs are running. Downstream jobs are determined +--- a/doc/source/general.rst ++++ b/doc/source/general.rst +@@ -21,6 +21,7 @@ later. There are a few basic optional f + display-name: 'Fancy job name' + concurrent: true + workspace: /srv/build-area/job-name ++ child-workspace: /srv/build-area/job-name + quiet-period: 5 + block-downstream: false + block-upstream: false +@@ -58,6 +59,10 @@ later. There are a few basic optional f + Path for a custom workspace. Defaults to Jenkins default + configuration. + ++ * **child-workspace**: ++ Path for a child custom workspace. Defaults to Jenkins default ++ configuration. ++ + * **quiet-period**: + Number of seconds to wait between consecutive runs of this job. + Defaults to ``0``. +--- a/jenkins_jobs/modules/general.py ++++ b/jenkins_jobs/modules/general.py +@@ -91,6 +91,9 @@ class General(jenkins_jobs.modules.base. + if 'workspace' in data: + XML.SubElement(xml, 'customWorkspace').text = \ + str(data['workspace']) ++ if 'child-workspace' in data: ++ XML.SubElement(xml, 'childCustomWorkspace').text = \ ++ str(data['child-workspace']) + if 'quiet-period' in data: + XML.SubElement(xml, 'quietPeriod').text = str(data['quiet-period']) + node = data.get('node', None) +--- /dev/null ++++ b/tests/general/fixtures/custom-workspace001.xml +@@ -0,0 +1,10 @@ ++ ++ ++ ++ false ++ false ++ false ++ false ++ foo ++ true ++ +--- /dev/null ++++ b/tests/general/fixtures/custom-workspace001.yaml +@@ -0,0 +1,2 @@ ++project-type: freestyle ++workspace: foo +--- /dev/null ++++ b/tests/general/fixtures/custom-workspace002.xml +@@ -0,0 +1,16 @@ ++ ++ ++ ++ false ++ ++ ++ ++ ++ false ++ false ++ false ++ false ++ foo ++ bar ++ true ++ +--- /dev/null ++++ b/tests/general/fixtures/custom-workspace002.yaml +@@ -0,0 +1,3 @@ ++project-type: matrix ++workspace: foo ++child-workspace: bar diff -Nru jenkins-job-builder-0.8.0/debian/patches/0005-builders-add-publish-over-ssh-support-as-a-build-ste.patch jenkins-job-builder-0.8.1/debian/patches/0005-builders-add-publish-over-ssh-support-as-a-build-ste.patch --- jenkins-job-builder-0.8.0/debian/patches/0005-builders-add-publish-over-ssh-support-as-a-build-ste.patch 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/0005-builders-add-publish-over-ssh-support-as-a-build-ste.patch 2014-06-15 16:15:24.000000000 +0000 @@ -0,0 +1,206 @@ +From bbab75677fa62bb3831edf6c9530d9d94110e157 Mon Sep 17 00:00:00 2001 +From: Fathi Boudra +Date: Fri, 6 Jun 2014 17:50:26 +0300 +Subject: [PATCH] builders: add 'publish over ssh' support as a build step + +'Publish over SSH' plugin is only supported in the publishers. +It can also be used as a build step during the build process. + +Adjustments to publishers.base_publish_over() method: + * fix the missing top delegate + * re-order command, timeout and use-pty as in Jenkins + +Change-Id: Id45ef1b84b88213d8673f34597571ca56e3ff986 +Signed-off-by: Fathi Boudra +--- + jenkins_jobs/modules/builders.py | 47 +++++++++++++++++++++++++++++++++++++ + jenkins_jobs/modules/publishers.py | 28 +++++++++++++--------- + setup.cfg | 1 + tests/builders/fixtures/ssh.xml | 36 ++++++++++++++++++++++++++++ + tests/builders/fixtures/ssh.yaml | 6 ++++ + 5 files changed, 107 insertions(+), 11 deletions(-) + create mode 100644 tests/builders/fixtures/ssh.xml + create mode 100644 tests/builders/fixtures/ssh.yaml + +--- a/jenkins_jobs/modules/builders.py ++++ b/jenkins_jobs/modules/builders.py +@@ -41,6 +41,7 @@ import xml.etree.ElementTree as XML + import jenkins_jobs.modules.base + from jenkins_jobs.modules import hudson_model + from jenkins_jobs.errors import JenkinsJobsException ++from jenkins_jobs.modules.publishers import base_publish_over + import logging + + logger = logging.getLogger(__name__) +@@ -1028,6 +1029,52 @@ def critical_block_end(parser, xml_paren + cbs.set('plugin', 'Exclusion') + + ++def ssh(parser, xml_parent, data): ++ """yaml: ssh ++ Send files or execute commands over SSH. ++ Requires the Jenkins `Publish over SSH Plugin. ++ `_ ++ ++ :arg str site: name of the ssh site ++ :arg str target: destination directory ++ :arg bool target-is-date-format: whether target is a date format. If true, ++ raw text should be quoted (defaults to False) ++ :arg bool clean-remote: should the remote directory be deleted before ++ transferring files (defaults to False) ++ :arg str source: source path specifier ++ :arg str command: a command to execute on the remote server (optional) ++ :arg int timeout: timeout in milliseconds for the Exec command (optional) ++ :arg bool use-pty: run the exec command in pseudo TTY (defaults to False) ++ :arg str excludes: excluded file pattern (optional) ++ :arg str remove-prefix: prefix to remove from uploaded file paths ++ (optional) ++ :arg bool fail-on-error: fail the build if an error occurs (defaults to ++ False). ++ ++ Example:: ++ ++ builders: ++ - ssh: ++ site: 'server.example.com' ++ target: 'dest/dir' ++ source: 'base/source/dir/**' ++ remove-prefix: 'base/source/dir' ++ excludes: '**/*.excludedfiletype' ++ use-pty: true ++ command: 'rm -r jenkins_$BUILD_NUMBER' ++ timeout: 1800000 ++ """ ++ console_prefix = 'SSH: ' ++ tag_prefix = 'jenkins.plugins.publish' ++ plugin_tag = '%s__over__ssh.BapSshBuilderPlugin' % tag_prefix ++ publisher_tag = '%s__over__ssh.BapSshPublisher' % tag_prefix ++ transfer_tag = '%s__over__ssh.BapSshTransfer' % tag_prefix ++ reference_tag = '%s_over_ssh.BapSshPublisherPlugin' % tag_prefix ++ ++ base_publish_over(xml_parent, data, console_prefix, plugin_tag, ++ publisher_tag, transfer_tag, reference_tag) ++ ++ + class Builders(jenkins_jobs.modules.base.Base): + sequence = 60 + +--- a/jenkins_jobs/modules/publishers.py ++++ b/jenkins_jobs/modules/publishers.py +@@ -1692,24 +1692,21 @@ def base_publish_over(xml_parent, data, + plugin_tag, publisher_tag, + transferset_tag, reference_plugin_tag): + outer = XML.SubElement(xml_parent, plugin_tag) +- XML.SubElement(outer, 'consolePrefix').text = console_prefix +- delegate = XML.SubElement(outer, 'delegate') ++ top_delegate = XML.SubElement(outer, 'delegate') ++ XML.SubElement(top_delegate, 'consolePrefix').text = console_prefix ++ ++ delegate = XML.SubElement(top_delegate, 'delegate') + publishers = XML.SubElement(delegate, 'publishers') ++ + inner = XML.SubElement(publishers, publisher_tag) + XML.SubElement(inner, 'configName').text = data['site'] + XML.SubElement(inner, 'verbose').text = 'true' + + transfers = XML.SubElement(inner, 'transfers') + transfersset = XML.SubElement(transfers, transferset_tag) ++ + XML.SubElement(transfersset, 'remoteDirectory').text = data['target'] + XML.SubElement(transfersset, 'sourceFiles').text = data['source'] +- if 'command' in data: +- XML.SubElement(transfersset, 'execCommand').text = data['command'] +- if 'timeout' in data: +- XML.SubElement(transfersset, 'execTimeout').text = str(data['timeout']) +- if 'use-pty' in data: +- XML.SubElement(transfersset, 'usePty').text = \ +- str(data.get('use-pty', False)).lower() + XML.SubElement(transfersset, 'excludes').text = data.get('excludes', '') + XML.SubElement(transfersset, 'removePrefix').text = \ + data.get('remove-prefix', '') +@@ -1719,16 +1716,25 @@ def base_publish_over(xml_parent, data, + XML.SubElement(transfersset, 'cleanRemote').text = \ + str(data.get('clean-remote', False)).lower() + ++ if 'command' in data: ++ XML.SubElement(transfersset, 'execCommand').text = data['command'] ++ if 'timeout' in data: ++ XML.SubElement(transfersset, 'execTimeout').text = str(data['timeout']) ++ if 'use-pty' in data: ++ XML.SubElement(transfersset, 'usePty').text = \ ++ str(data.get('use-pty', False)).lower() ++ + XML.SubElement(inner, 'useWorkspaceInPromotion').text = 'false' + XML.SubElement(inner, 'usePromotionTimestamp').text = 'false' ++ + XML.SubElement(delegate, 'continueOnError').text = 'false' + XML.SubElement(delegate, 'failOnError').text = \ + str(data.get('fail-on-error', False)).lower() + XML.SubElement(delegate, 'alwaysPublishFromMaster').text = \ + str(data.get('always-publish-from-master', False)).lower() + XML.SubElement(delegate, 'hostConfigurationAccess', +- {'class': reference_plugin_tag, +- 'reference': '../..'}) ++ {'class': reference_plugin_tag, 'reference': '../..'}) ++ + return (outer, transfersset) + + +--- a/setup.cfg ++++ b/setup.cfg +@@ -59,6 +59,7 @@ jenkins_jobs.builders = + shell=jenkins_jobs.modules.builders:shell + shining-panda=jenkins_jobs.modules.builders:shining_panda + trigger-builds=jenkins_jobs.modules.builders:trigger_builds ++ ssh=jenkins_jobs.modules.builders:ssh + jenkins_jobs.reporters = + email=jenkins_jobs.modules.reporters:email + jenkins_jobs.properties = +--- /dev/null ++++ b/tests/builders/fixtures/ssh.xml +@@ -0,0 +1,36 @@ ++ ++ ++ ++ ++ ++ SSH: ++ ++ ++ ++ server.example.com ++ true ++ ++ ++ dest/dir ++ base/source/dir/** ++ ++ ++ false ++ false ++ false ++ 1800000 ++ ++ ++ false ++ false ++ ++ ++ false ++ false ++ false ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ b/tests/builders/fixtures/ssh.yaml +@@ -0,0 +1,6 @@ ++builders: ++ - ssh: ++ site: 'server.example.com' ++ target: 'dest/dir' ++ source: 'base/source/dir/**' ++ timeout: 1800000 diff -Nru jenkins-job-builder-0.8.0/debian/patches/authorization-property-add-extended-read-support.patch jenkins-job-builder-0.8.1/debian/patches/authorization-property-add-extended-read-support.patch --- jenkins-job-builder-0.8.0/debian/patches/authorization-property-add-extended-read-support.patch 2014-06-02 05:24:48.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/authorization-property-add-extended-read-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -From c6c81a29657a9733374f10ce1903bdc6c29d9687 Mon Sep 17 00:00:00 2001 -From: Fathi Boudra -Date: Sun, 1 Jun 2014 15:59:59 +0300 -Subject: [PATCH] authorization property: add extended read support - -This authorization requires the extended read permission plugin: -https://wiki.jenkins-ci.org/display/JENKINS/Extended+Read+Permission+Plugin - -Include test for the authorization properties. - -Change-Id: I9364524398f4e3f0d6ccccd88d5046e7504e2123 -Signed-off-by: Fathi Boudra ---- - jenkins_jobs/modules/properties.py | 3 +++ - tests/properties/fixtures/authorization.xml | 9 +++++++++ - tests/properties/fixtures/authorization.yaml | 5 +++++ - 3 files changed, 17 insertions(+) - create mode 100644 tests/properties/fixtures/authorization.xml - create mode 100644 tests/properties/fixtures/authorization.yaml - ---- a/jenkins_jobs/modules/properties.py -+++ b/jenkins_jobs/modules/properties.py -@@ -287,6 +287,7 @@ def authorization(parser, xml_parent, da - job-delete - job-configure - job-read -+ job-extended-read - job-discover - job-build - job-workspace -@@ -313,12 +314,14 @@ def authorization(parser, xml_parent, da - anonymous: - - job-discover - - job-read -+ - job-extended-read - """ - - mapping = { - 'job-delete': 'hudson.model.Item.Delete', - 'job-configure': 'hudson.model.Item.Configure', - 'job-read': 'hudson.model.Item.Read', -+ 'job-extended-read': 'hudson.model.Item.ExtendedRead', - 'job-discover': 'hudson.model.Item.Discover', - 'job-build': 'hudson.model.Item.Build', - 'job-workspace': 'hudson.model.Item.Workspace', ---- /dev/null -+++ b/tests/properties/fixtures/authorization.xml -@@ -0,0 +1,9 @@ -+ -+ -+ -+ -+ hudson.model.Item.Read:anonymous -+ hudson.model.Item.ExtendedRead:anonymous -+ -+ -+ ---- /dev/null -+++ b/tests/properties/fixtures/authorization.yaml -@@ -0,0 +1,5 @@ -+properties: -+ - authorization: -+ anonymous: -+ - job-read -+ - job-extended-read diff -Nru jenkins-job-builder-0.8.0/debian/patches/general-add-support-for-childCustomWorkspace.patch jenkins-job-builder-0.8.1/debian/patches/general-add-support-for-childCustomWorkspace.patch --- jenkins-job-builder-0.8.0/debian/patches/general-add-support-for-childCustomWorkspace.patch 2014-06-02 05:24:49.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/general-add-support-for-childCustomWorkspace.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -From 2bbf287dc9034d1314ffb486306f86e509af5c69 Mon Sep 17 00:00:00 2001 -From: Fathi Boudra -Date: Sun, 1 Jun 2014 19:12:05 +0300 -Subject: [PATCH] general: add support for childCustomWorkspace - -On freestyle project, we can set custom workspace. -On matrix project, we can set custom workspace and child custom workspace. - -It allows to specify the directory for sub-builds. - -Change-Id: Icef3831174ff805e86f1ece84fef9a438f465691 -Signed-off-by: Fathi Boudra ---- - doc/source/configuration.rst | 4 ++++ - doc/source/general.rst | 4 ++++ - jenkins_jobs/modules/general.py | 3 +++ - tests/general/fixtures/custom-workspace001.xml | 10 ++++++++++ - tests/general/fixtures/custom-workspace001.yaml | 2 ++ - tests/general/fixtures/custom-workspace002.xml | 16 ++++++++++++++++ - tests/general/fixtures/custom-workspace002.yaml | 3 +++ - 7 files changed, 42 insertions(+) - create mode 100644 tests/general/fixtures/custom-workspace001.xml - create mode 100644 tests/general/fixtures/custom-workspace001.yaml - create mode 100644 tests/general/fixtures/custom-workspace002.xml - create mode 100644 tests/general/fixtures/custom-workspace002.yaml - ---- a/doc/source/configuration.rst -+++ b/doc/source/configuration.rst -@@ -76,6 +76,10 @@ later. There are a few basic optional f - Path for a custom workspace. Defaults to Jenkins default - configuration. - -+**child-workspace** -+ Path for a child custom workspace. Defaults to Jenkins default -+ configuration. -+ - **block-downstream** - Boolean value to set whether or not this job must block while - downstream jobs are running. Downstream jobs are determined ---- a/doc/source/general.rst -+++ b/doc/source/general.rst -@@ -58,6 +58,10 @@ later. There are a few basic optional f - Path for a custom workspace. Defaults to Jenkins default - configuration. - -+ * **child-workspace**: -+ Path for a child custom workspace. Defaults to Jenkins default -+ configuration. -+ - * **quiet-period**: - Number of seconds to wait between consecutive runs of this job. - Defaults to ``0``. ---- a/jenkins_jobs/modules/general.py -+++ b/jenkins_jobs/modules/general.py -@@ -91,6 +91,9 @@ class General(jenkins_jobs.modules.base. - if 'workspace' in data: - XML.SubElement(xml, 'customWorkspace').text = \ - str(data['workspace']) -+ if 'child-workspace' in data: -+ XML.SubElement(xml, 'childCustomWorkspace').text = \ -+ str(data['child-workspace']) - if 'quiet-period' in data: - XML.SubElement(xml, 'quietPeriod').text = str(data['quiet-period']) - node = data.get('node', None) ---- /dev/null -+++ b/tests/general/fixtures/custom-workspace001.xml -@@ -0,0 +1,10 @@ -+ -+ -+ -+ false -+ false -+ false -+ false -+ foo -+ true -+ ---- /dev/null -+++ b/tests/general/fixtures/custom-workspace001.yaml -@@ -0,0 +1,2 @@ -+project-type: freestyle -+workspace: foo ---- /dev/null -+++ b/tests/general/fixtures/custom-workspace002.xml -@@ -0,0 +1,16 @@ -+ -+ -+ -+ false -+ -+ -+ -+ -+ false -+ false -+ false -+ false -+ foo -+ bar -+ true -+ ---- /dev/null -+++ b/tests/general/fixtures/custom-workspace002.yaml -@@ -0,0 +1,3 @@ -+project-type: matrix -+workspace: foo -+child-workspace: bar diff -Nru jenkins-job-builder-0.8.0/debian/patches/matrix-project-add-support-for-dynamic-axis.patch jenkins-job-builder-0.8.1/debian/patches/matrix-project-add-support-for-dynamic-axis.patch --- jenkins-job-builder-0.8.0/debian/patches/matrix-project-add-support-for-dynamic-axis.patch 2014-06-02 05:24:49.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/matrix-project-add-support-for-dynamic-axis.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -From 32530fa18f2add48c1456d1f5c7079313e21b10a Mon Sep 17 00:00:00 2001 -From: Fathi Boudra -Date: Sun, 1 Jun 2014 20:02:36 +0300 -Subject: [PATCH] matrix project: add support for dynamic axis - -This axis requires the dynamic axis plugin: -https://wiki.jenkins-ci.org/display/JENKINS/DynamicAxis+Plugin - -All the dynamic axis plugin settings are in the core project: - - - - - config - - config_list - - config_list - - default - - - - -The plugin sets 2 values: axis name and variable name. -The axisValue element is hardcoded to 'default' in the plugin, so we do -the same in Jenkins job builder. - -Change-Id: I36310bc512fd873fec4bd5f42937689fd178536e -Signed-off-by: Fathi Boudra ---- - jenkins_jobs/modules/project_matrix.py | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - ---- a/jenkins_jobs/modules/project_matrix.py -+++ b/jenkins_jobs/modules/project_matrix.py -@@ -24,6 +24,13 @@ internal YAML structure: - * user-defined values (``user-defined``) - * slave name or label (``slave``) - -+The module supports also dynamic axis: -+ -+* dynamic (``dynamic``) -+ -+Requires the Jenkins `dynamic axis Plugin. -+`_ -+ - :Job Parameters: - * **execution-strategy** (optional): - * **combination-filter** (`str`): axes selection filter -@@ -70,6 +77,11 @@ Example:: - values: - - node1 - - node2 -+ - axis: -+ type: dynamic -+ name: config -+ values: -+ - config_list - builders: - - shell: make && make check - -@@ -103,6 +115,7 @@ class Matrix(jenkins_jobs.modules.base.B - 'label-expression': 'hudson.matrix.LabelExpAxis', - 'user-defined': 'hudson.matrix.TextAxis', - 'slave': 'hudson.matrix.LabelAxis', -+ 'dynamic': 'ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis', - } - - def root_xml(self, data): -@@ -143,7 +156,13 @@ class Matrix(jenkins_jobs.modules.base.B - name, values = axis['name'], axis['values'] - XML.SubElement(lbl_root, 'name').text = str(name) - v_root = XML.SubElement(lbl_root, 'values') -- for v in values: -- XML.SubElement(v_root, 'string').text = str(v) -+ if axis['type'] == "dynamic": -+ XML.SubElement(v_root, 'string').text = str(values[0]) -+ XML.SubElement(lbl_root, 'varName').text = str(values[0]) -+ v_root = XML.SubElement(lbl_root, 'axisValues') -+ XML.SubElement(v_root, 'string').text = 'default' -+ else: -+ for v in values: -+ XML.SubElement(v_root, 'string').text = str(v) - - return root diff -Nru jenkins-job-builder-0.8.0/debian/patches/series jenkins-job-builder-0.8.1/debian/patches/series --- jenkins-job-builder-0.8.0/debian/patches/series 2014-06-02 05:24:37.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/series 2014-06-15 16:10:59.000000000 +0000 @@ -1,4 +1,5 @@ workaround-programoutput.patch -authorization-property-add-extended-read-support.patch -general-add-support-for-childCustomWorkspace.patch -matrix-project-add-support-for-dynamic-axis.patch + +# Submitted upstream +0002-general-add-support-for-childCustomWorkspace.patch +0005-builders-add-publish-over-ssh-support-as-a-build-ste.patch diff -Nru jenkins-job-builder-0.8.0/debian/patches/workaround-programoutput.patch jenkins-job-builder-0.8.1/debian/patches/workaround-programoutput.patch --- jenkins-job-builder-0.8.0/debian/patches/workaround-programoutput.patch 2014-05-24 11:38:24.000000000 +0000 +++ jenkins-job-builder-0.8.1/debian/patches/workaround-programoutput.patch 2014-06-15 16:11:27.000000000 +0000 @@ -13,7 +13,7 @@ --- a/doc/source/installation.rst +++ b/doc/source/installation.rst -@@ -87,7 +87,8 @@ section. +@@ -94,7 +94,8 @@ section. Usage ^^^^^ diff -Nru jenkins-job-builder-0.8.0/doc/source/configuration.rst jenkins-job-builder-0.8.1/doc/source/configuration.rst --- jenkins-job-builder-0.8.0/doc/source/configuration.rst 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/doc/source/configuration.rst 2014-06-12 04:49:02.000000000 +0000 @@ -123,12 +123,6 @@ definition. It's name will depend on what is supplied to the `Project`_. -If you want to use lists or dicts variables you can use ``{obj:key}``. - -For example: - -.. literalinclude:: /../../tests/yamlparser/fixtures/custom_distri.yaml - .. _project: Project @@ -152,22 +146,6 @@ The ``jobs:`` list can also allow for specifying job-specific substitutions as follows:: - - job-template: - name: '{name}-unit-tests' - builders: - - shell: unittest - publishers: - - email: - recipients: '{mail-to}' - - - job-template: - name: '{name}-perf-tests' - builders: - - shell: perftest - publishers: - - email: - recipients: '{mail-to}' - - project: name: project-name jobs: @@ -176,6 +154,7 @@ - '{name}-perf-tests': mail-to: projmanager@nowhere.net + If a variable is a list, the job template will be realized with the variable set to each value in the list. Multiple lists will lead to the template being realized with the cartesian product of those @@ -184,10 +163,16 @@ - project: name: project-name pyver: - - 26 - - 27 + - 26 + - 27 jobs: - - '{name}-{pyver}' + - '{name}-{pyver}' + +If there are templates being realized that differ only in the variable +used for its name (thus not a use case for job-specific substitutions), +additional variables can be specified for project variables. Example:: + +.. literalinclude:: /../../tests/yamlparser/fixtures/templates002.yaml Job Group ^^^^^^^^^ @@ -195,39 +180,13 @@ If you have several Job Templates that should all be realized together, you can define a Job Group to collect them. Simply use the Job Group where you would normally use a `Job Template`_ and all of -the Job Templates in the Job Group will be realized. For example:: +the Job Templates in the Job Group will be realized. For example: - - job-template: - name: '{name}-python-26' +.. literalinclude:: /../../tests/yamlparser/fixtures/templates001.yaml - - job-template: - name: '{name}-python-27' - - - job-group: - name: python-jobs - jobs: - - '{name}-python-26' - - '{name}-python-27' - - - project: - name: foo - jobs: - - python-jobs - -Would cause the jobs `foo-python-26` and `foo-python-27` to be created +Would cause the jobs `project-name-unit-tests` and `project-name-perf-tests` to be created in Jenkins. -The ``jobs:`` list can also allow for specifying job-specific -substitutions as follows:: - - - job-group: - name: job-group-name - jobs: - - '{name}-build': - pipeline-next: '{name}-upload' - - '{name}-upload': - pipeline-next: '' - .. _macro: Macro @@ -331,6 +290,17 @@ Will set the job description for every job created. +.. _advanced: + +Advanced +^^^^^^^^ + +If you want to use lists or dicts variables you can use ``{obj:key}``. + +For example: + +.. literalinclude:: /../../tests/yamlparser/fixtures/custom_distri.yaml + Modules ------- diff -Nru jenkins-job-builder-0.8.0/doc/source/installation.rst jenkins-job-builder-0.8.1/doc/source/installation.rst --- jenkins-job-builder-0.8.0/doc/source/installation.rst 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/doc/source/installation.rst 2014-06-12 04:49:00.000000000 +0000 @@ -9,7 +9,7 @@ systems, including Jenkins. If you use Puppet, you can use the `OpenStack Jenkins module`__ to install Jenkins Job Builder. -__ https://github.com/openstack-infra/config/tree/master/modules/jenkins +__ https://git.openstack.org/cgit/openstack-infra/config/tree/modules/jenkins Documentation ------------- @@ -34,6 +34,13 @@ * Note: View ``tox.ini`` to run tests on other versions of Python. +Test Coverage +------------- + +To measure test coverage, execute the command:: + + tox -e cover + Configuration File ------------------ diff -Nru jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/entry_points.txt jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/entry_points.txt --- jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/entry_points.txt 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/entry_points.txt 2014-06-12 04:49:29.000000000 +0000 @@ -1,196 +1,196 @@ -[jenkins_jobs.publishers] -jira = jenkins_jobs.modules.publishers:jira -testng = jenkins_jobs.modules.publishers:testng -tap = jenkins_jobs.modules.publishers:tap -checkstyle = jenkins_jobs.modules.publishers:checkstyle -claim-build = jenkins_jobs.modules.publishers:claim_build -ruby-metrics = jenkins_jobs.modules.publishers:ruby_metrics -artifact-deployer = jenkins_jobs.modules.publishers:artifact_deployer -build-publisher = jenkins_jobs.modules.publishers:build_publisher -robot = jenkins_jobs.modules.publishers:robot -description-setter = jenkins_jobs.modules.publishers:description_setter -performance = jenkins_jobs.modules.publishers:performance -coverage = jenkins_jobs.modules.publishers:coverage -email-ext = jenkins_jobs.modules.publishers:email_ext -jabber = jenkins_jobs.modules.publishers:jabber -archive = jenkins_jobs.modules.publishers:archive -github-notifier = jenkins_jobs.modules.publishers:github_notifier -ftp = jenkins_jobs.modules.publishers:ftp -sitemonitor = jenkins_jobs.modules.publishers:sitemonitor -git = jenkins_jobs.modules.publishers:git -trigger = jenkins_jobs.modules.publishers:trigger -plot = jenkins_jobs.modules.publishers:plot -warnings = jenkins_jobs.modules.publishers:warnings -cloverphp = jenkins_jobs.modules.publishers:cloverphp -blame-upstream = jenkins_jobs.modules.publishers:blame_upstream -copy-to-master = jenkins_jobs.modules.publishers:copy_to_master -campfire = jenkins_jobs.modules.publishers:campfire -workspace-cleanup = jenkins_jobs.modules.publishers:workspace_cleanup -groovy-postbuild = jenkins_jobs.modules.publishers:groovy_postbuild -cppcheck = jenkins_jobs.modules.publishers:cppcheck -violations = jenkins_jobs.modules.publishers:violations -postbuildscript = jenkins_jobs.modules.publishers:postbuildscript -cobertura = jenkins_jobs.modules.publishers:cobertura -fitnesse = jenkins_jobs.modules.publishers:fitnesse -cifs = jenkins_jobs.modules.publishers:cifs -ircbot = jenkins_jobs.modules.publishers:ircbot -emotional-jenkins = jenkins_jobs.modules.publishers:emotional_jenkins -xml-summary = jenkins_jobs.modules.publishers:xml_summary -trigger-parameterized-builds = jenkins_jobs.modules.publishers:trigger_parameterized_builds -cigame = jenkins_jobs.modules.publishers:cigame -ssh = jenkins_jobs.modules.publishers:ssh -post-tasks = jenkins_jobs.modules.publishers:post_tasks -aggregate-tests = jenkins_jobs.modules.publishers:aggregate_tests -fingerprint = jenkins_jobs.modules.publishers:fingerprint -sloccount = jenkins_jobs.modules.publishers:sloccount -text-finder = jenkins_jobs.modules.publishers:text_finder -html-publisher = jenkins_jobs.modules.publishers:html_publisher -pipeline = jenkins_jobs.modules.publishers:pipeline -doxygen = jenkins_jobs.modules.publishers:doxygen -maven-deploy = jenkins_jobs.modules.publishers:maven_deploy -scp = jenkins_jobs.modules.publishers:scp -junit = jenkins_jobs.modules.publishers:junit -stash = jenkins_jobs.modules.publishers:stash -email = jenkins_jobs.modules.publishers:email -clone-workspace = jenkins_jobs.modules.publishers:clone_workspace -sonar = jenkins_jobs.modules.publishers:sonar -xunit = jenkins_jobs.modules.publishers:xunit -jacoco = jenkins_jobs.modules.publishers:jacoco -logparser = jenkins_jobs.modules.publishers:logparser -join-trigger = jenkins_jobs.modules.publishers:join_trigger +[console_scripts] +jenkins-jobs = jenkins_jobs.cmd:main -[jenkins_jobs.projects] -freestyle = jenkins_jobs.modules.project_freestyle:Freestyle -maven = jenkins_jobs.modules.project_maven:Maven -flow = jenkins_jobs.modules.project_flow:Flow -matrix = jenkins_jobs.modules.project_matrix:Matrix -multijob = jenkins_jobs.modules.project_multijob:MultiJob +[jenkins_jobs.builders] +ant = jenkins_jobs.modules.builders:ant +artifact-resolver = jenkins_jobs.modules.builders:artifact_resolver +batch = jenkins_jobs.modules.builders:batch +builders-from = jenkins_jobs.modules.builders:builders_from +conditional-step = jenkins_jobs.modules.builders:conditional_step +copyartifact = jenkins_jobs.modules.builders:copyartifact +critical-block-end = jenkins_jobs.modules.builders:critical_block_end +critical-block-start = jenkins_jobs.modules.builders:critical_block_start +gradle = jenkins_jobs.modules.builders:gradle +grails = jenkins_jobs.modules.builders:grails +inject = jenkins_jobs.modules.builders:inject +maven-target = jenkins_jobs.modules.builders:maven_target +msbuild = jenkins_jobs.modules.builders:msbuild +multijob = jenkins_jobs.modules.builders:multijob +python = jenkins_jobs.modules.builders:python +sbt = jenkins_jobs.modules.builders:sbt +shell = jenkins_jobs.modules.builders:shell +shining-panda = jenkins_jobs.modules.builders:shining_panda +trigger-builds = jenkins_jobs.modules.builders:trigger_builds + +[jenkins_jobs.metadata] +date = jenkins_jobs.modules.metadata:date_metadata +number = jenkins_jobs.modules.metadata:number_metadata +string = jenkins_jobs.modules.metadata:string_metadata [jenkins_jobs.modules] -scm = jenkins_jobs.modules.scm:SCM -publishers = jenkins_jobs.modules.publishers:Publishers -zuul = jenkins_jobs.modules.zuul:Zuul -parameters = jenkins_jobs.modules.parameters:Parameters -triggers = jenkins_jobs.modules.triggers:Triggers +builders = jenkins_jobs.modules.builders:Builders general = jenkins_jobs.modules.general:General -notifications = jenkins_jobs.modules.notifications:Notifications -wrappers = jenkins_jobs.modules.wrappers:Wrappers -reporters = jenkins_jobs.modules.reporters:Reporters hipchat = jenkins_jobs.modules.hipchat_notif:HipChat -builders = jenkins_jobs.modules.builders:Builders -properties = jenkins_jobs.modules.properties:Properties metadata = jenkins_jobs.modules.metadata:Metadata +notifications = jenkins_jobs.modules.notifications:Notifications +parameters = jenkins_jobs.modules.parameters:Parameters +properties = jenkins_jobs.modules.properties:Properties +publishers = jenkins_jobs.modules.publishers:Publishers +reporters = jenkins_jobs.modules.reporters:Reporters +scm = jenkins_jobs.modules.scm:SCM +triggers = jenkins_jobs.modules.triggers:Triggers +wrappers = jenkins_jobs.modules.wrappers:Wrappers +zuul = jenkins_jobs.modules.zuul:Zuul -[jenkins_jobs.triggers] -github = jenkins_jobs.modules.triggers:github -script = jenkins_jobs.modules.triggers:script -gerrit = jenkins_jobs.modules.triggers:gerrit -github-pull-request = jenkins_jobs.modules.triggers:github_pull_request -pollscm = jenkins_jobs.modules.triggers:pollscm -build-result = jenkins_jobs.modules.triggers:build_result -timed = jenkins_jobs.modules.triggers:timed - -[jenkins_jobs.metadata] -date = jenkins_jobs.modules.metadata:date_metadata -number = jenkins_jobs.modules.metadata:number_metadata -string = jenkins_jobs.modules.metadata:string_metadata +[jenkins_jobs.notifications] +http = jenkins_jobs.modules.notifications:http_endpoint -[jenkins_jobs.scm] -repo = jenkins_jobs.modules.scm:repo -svn = jenkins_jobs.modules.scm:svn -git = jenkins_jobs.modules.scm:git -workspace = jenkins_jobs.modules.scm:workspace -tfs = jenkins_jobs.modules.scm:tfs +[jenkins_jobs.parameters] +bool = jenkins_jobs.modules.parameters:bool_param +choice = jenkins_jobs.modules.parameters:choice_param +dynamic-choice = jenkins_jobs.modules.parameters:dynamic_choice_param +dynamic-choice-scriptler = jenkins_jobs.modules.parameters:dynamic_choice_scriptler_param +dynamic-string = jenkins_jobs.modules.parameters:dynamic_string_param +dynamic-string-scriptler = jenkins_jobs.modules.parameters:dynamic_string_scriptler_param +file = jenkins_jobs.modules.parameters:file_param +label = jenkins_jobs.modules.parameters:label_param +password = jenkins_jobs.modules.parameters:password_param +string = jenkins_jobs.modules.parameters:string_param +svn-tags = jenkins_jobs.modules.parameters:svn_tags_param +text = jenkins_jobs.modules.parameters:text_param +validating-string = jenkins_jobs.modules.parameters:validating_string_param -[console_scripts] -jenkins-jobs = jenkins_jobs.cmd:main +[jenkins_jobs.projects] +flow = jenkins_jobs.modules.project_flow:Flow +freestyle = jenkins_jobs.modules.project_freestyle:Freestyle +matrix = jenkins_jobs.modules.project_matrix:Matrix +maven = jenkins_jobs.modules.project_maven:Maven +multijob = jenkins_jobs.modules.project_multijob:MultiJob [jenkins_jobs.properties] -least-load = jenkins_jobs.modules.properties:least_load -github = jenkins_jobs.modules.properties:github -throttle = jenkins_jobs.modules.properties:throttle -priority-sorter = jenkins_jobs.modules.properties:priority_sorter -build-blocker = jenkins_jobs.modules.properties:build_blocker -extended-choice = jenkins_jobs.modules.properties:extended_choice -heavy-job = jenkins_jobs.modules.properties:heavy_job +authenticated-build = jenkins_jobs.modules.properties:authenticated_build +authorization = jenkins_jobs.modules.properties:authorization batch-tasks = jenkins_jobs.modules.properties:batch_tasks -zeromq-event = jenkins_jobs.modules.properties:zeromq_event -promoted-build = jenkins_jobs.modules.properties:promoted_build -delivery-pipeline = jenkins_jobs.modules.properties:delivery_pipeline +build-blocker = jenkins_jobs.modules.properties:build_blocker builds-chain-fingerprinter = jenkins_jobs.modules.properties:builds_chain_fingerprinter copyartifact = jenkins_jobs.modules.properties:copyartifact +delivery-pipeline = jenkins_jobs.modules.properties:delivery_pipeline +extended-choice = jenkins_jobs.modules.properties:extended_choice +github = jenkins_jobs.modules.properties:github +heavy-job = jenkins_jobs.modules.properties:heavy_job +inject = jenkins_jobs.modules.properties:inject +least-load = jenkins_jobs.modules.properties:least_load ownership = jenkins_jobs.modules.properties:ownership +priority-sorter = jenkins_jobs.modules.properties:priority_sorter +promoted-build = jenkins_jobs.modules.properties:promoted_build slave-utilization = jenkins_jobs.modules.properties:slave_utilization -authenticated-build = jenkins_jobs.modules.properties:authenticated_build -authorization = jenkins_jobs.modules.properties:authorization -inject = jenkins_jobs.modules.properties:inject - -[jenkins_jobs.builders] -critical-block-start = jenkins_jobs.modules.builders:critical_block_start -maven-target = jenkins_jobs.modules.builders:maven_target -msbuild = jenkins_jobs.modules.builders:msbuild -trigger-builds = jenkins_jobs.modules.builders:trigger_builds -sbt = jenkins_jobs.modules.builders:sbt -python = jenkins_jobs.modules.builders:python -inject = jenkins_jobs.modules.builders:inject -grails = jenkins_jobs.modules.builders:grails -batch = jenkins_jobs.modules.builders:batch -gradle = jenkins_jobs.modules.builders:gradle -ant = jenkins_jobs.modules.builders:ant -builders-from = jenkins_jobs.modules.builders:builders_from -shining-panda = jenkins_jobs.modules.builders:shining_panda -shell = jenkins_jobs.modules.builders:shell -copyartifact = jenkins_jobs.modules.builders:copyartifact -conditional-step = jenkins_jobs.modules.builders:conditional_step -artifact-resolver = jenkins_jobs.modules.builders:artifact_resolver -multijob = jenkins_jobs.modules.builders:multijob -critical-block-end = jenkins_jobs.modules.builders:critical_block_end +throttle = jenkins_jobs.modules.properties:throttle +zeromq-event = jenkins_jobs.modules.properties:zeromq_event -[jenkins_jobs.notifications] -http = jenkins_jobs.modules.notifications:http_endpoint +[jenkins_jobs.publishers] +aggregate-tests = jenkins_jobs.modules.publishers:aggregate_tests +archive = jenkins_jobs.modules.publishers:archive +artifact-deployer = jenkins_jobs.modules.publishers:artifact_deployer +blame-upstream = jenkins_jobs.modules.publishers:blame_upstream +build-publisher = jenkins_jobs.modules.publishers:build_publisher +campfire = jenkins_jobs.modules.publishers:campfire +checkstyle = jenkins_jobs.modules.publishers:checkstyle +cifs = jenkins_jobs.modules.publishers:cifs +cigame = jenkins_jobs.modules.publishers:cigame +claim-build = jenkins_jobs.modules.publishers:claim_build +clone-workspace = jenkins_jobs.modules.publishers:clone_workspace +cloverphp = jenkins_jobs.modules.publishers:cloverphp +cobertura = jenkins_jobs.modules.publishers:cobertura +copy-to-master = jenkins_jobs.modules.publishers:copy_to_master +coverage = jenkins_jobs.modules.publishers:coverage +cppcheck = jenkins_jobs.modules.publishers:cppcheck +description-setter = jenkins_jobs.modules.publishers:description_setter +doxygen = jenkins_jobs.modules.publishers:doxygen +email = jenkins_jobs.modules.publishers:email +email-ext = jenkins_jobs.modules.publishers:email_ext +emotional-jenkins = jenkins_jobs.modules.publishers:emotional_jenkins +fingerprint = jenkins_jobs.modules.publishers:fingerprint +fitnesse = jenkins_jobs.modules.publishers:fitnesse +ftp = jenkins_jobs.modules.publishers:ftp +git = jenkins_jobs.modules.publishers:git +github-notifier = jenkins_jobs.modules.publishers:github_notifier +groovy-postbuild = jenkins_jobs.modules.publishers:groovy_postbuild +html-publisher = jenkins_jobs.modules.publishers:html_publisher +ircbot = jenkins_jobs.modules.publishers:ircbot +jabber = jenkins_jobs.modules.publishers:jabber +jacoco = jenkins_jobs.modules.publishers:jacoco +jira = jenkins_jobs.modules.publishers:jira +join-trigger = jenkins_jobs.modules.publishers:join_trigger +junit = jenkins_jobs.modules.publishers:junit +logparser = jenkins_jobs.modules.publishers:logparser +maven-deploy = jenkins_jobs.modules.publishers:maven_deploy +performance = jenkins_jobs.modules.publishers:performance +pipeline = jenkins_jobs.modules.publishers:pipeline +plot = jenkins_jobs.modules.publishers:plot +post-tasks = jenkins_jobs.modules.publishers:post_tasks +postbuildscript = jenkins_jobs.modules.publishers:postbuildscript +robot = jenkins_jobs.modules.publishers:robot +ruby-metrics = jenkins_jobs.modules.publishers:ruby_metrics +scp = jenkins_jobs.modules.publishers:scp +sitemonitor = jenkins_jobs.modules.publishers:sitemonitor +sloccount = jenkins_jobs.modules.publishers:sloccount +sonar = jenkins_jobs.modules.publishers:sonar +ssh = jenkins_jobs.modules.publishers:ssh +stash = jenkins_jobs.modules.publishers:stash +tap = jenkins_jobs.modules.publishers:tap +testng = jenkins_jobs.modules.publishers:testng +text-finder = jenkins_jobs.modules.publishers:text_finder +trigger = jenkins_jobs.modules.publishers:trigger +trigger-parameterized-builds = jenkins_jobs.modules.publishers:trigger_parameterized_builds +violations = jenkins_jobs.modules.publishers:violations +warnings = jenkins_jobs.modules.publishers:warnings +workspace-cleanup = jenkins_jobs.modules.publishers:workspace_cleanup +xml-summary = jenkins_jobs.modules.publishers:xml_summary +xunit = jenkins_jobs.modules.publishers:xunit [jenkins_jobs.reporters] email = jenkins_jobs.modules.reporters:email -[jenkins_jobs.parameters] -password = jenkins_jobs.modules.parameters:password_param -string = jenkins_jobs.modules.parameters:string_param -validating-string = jenkins_jobs.modules.parameters:validating_string_param -svn-tags = jenkins_jobs.modules.parameters:svn_tags_param -text = jenkins_jobs.modules.parameters:text_param -dynamic-choice = jenkins_jobs.modules.parameters:dynamic_choice_param -choice = jenkins_jobs.modules.parameters:choice_param -dynamic-choice-scriptler = jenkins_jobs.modules.parameters:dynamic_choice_scriptler_param -bool = jenkins_jobs.modules.parameters:bool_param -file = jenkins_jobs.modules.parameters:file_param -dynamic-string = jenkins_jobs.modules.parameters:dynamic_string_param -dynamic-string-scriptler = jenkins_jobs.modules.parameters:dynamic_string_scriptler_param -label = jenkins_jobs.modules.parameters:label_param +[jenkins_jobs.scm] +git = jenkins_jobs.modules.scm:git +repo = jenkins_jobs.modules.scm:repo +svn = jenkins_jobs.modules.scm:svn +tfs = jenkins_jobs.modules.scm:tfs +workspace = jenkins_jobs.modules.scm:workspace + +[jenkins_jobs.triggers] +build-result = jenkins_jobs.modules.triggers:build_result +gerrit = jenkins_jobs.modules.triggers:gerrit +github = jenkins_jobs.modules.triggers:github +github-pull-request = jenkins_jobs.modules.triggers:github_pull_request +pollscm = jenkins_jobs.modules.triggers:pollscm +script = jenkins_jobs.modules.triggers:script +timed = jenkins_jobs.modules.triggers:timed [jenkins_jobs.wrappers] +ansicolor = jenkins_jobs.modules.wrappers:ansicolor +build-name = jenkins_jobs.modules.wrappers:build_name build-user-vars = jenkins_jobs.modules.wrappers:build_user_vars -locks = jenkins_jobs.modules.wrappers:locks -delivery-pipeline = jenkins_jobs.modules.wrappers:delivery_pipeline ci-skip = jenkins_jobs.modules.wrappers:ci_skip -pathignore = jenkins_jobs.modules.wrappers:pathignore -mask-passwords = jenkins_jobs.modules.wrappers:mask_passwords +copy-to-slave = jenkins_jobs.modules.wrappers:copy_to_slave +delivery-pipeline = jenkins_jobs.modules.wrappers:delivery_pipeline +env-file = jenkins_jobs.modules.wrappers:env_file exclusion = jenkins_jobs.modules.wrappers:exclusion -matrix-tie-parent = jenkins_jobs.modules.wrappers:matrix_tie_parent inject = jenkins_jobs.modules.wrappers:inject -sauce-ondemand = jenkins_jobs.modules.wrappers:sauce_ondemand -timestamps = jenkins_jobs.modules.wrappers:timestamps -workspace-cleanup = jenkins_jobs.modules.wrappers:workspace_cleanup -copy-to-slave = jenkins_jobs.modules.wrappers:copy_to_slave -pre-scm-buildstep = jenkins_jobs.modules.wrappers:pre_scm_buildstep -release = jenkins_jobs.modules.wrappers:release -ansicolor = jenkins_jobs.modules.wrappers:ansicolor -build-name = jenkins_jobs.modules.wrappers:build_name -port-allocator = jenkins_jobs.modules.wrappers:port_allocator +inject-passwords = jenkins_jobs.modules.wrappers:inject_passwords jclouds = jenkins_jobs.modules.wrappers:jclouds +locks = jenkins_jobs.modules.wrappers:locks logstash = jenkins_jobs.modules.wrappers:logstash -inject-passwords = jenkins_jobs.modules.wrappers:inject_passwords +mask-passwords = jenkins_jobs.modules.wrappers:mask_passwords +matrix-tie-parent = jenkins_jobs.modules.wrappers:matrix_tie_parent +pathignore = jenkins_jobs.modules.wrappers:pathignore +port-allocator = jenkins_jobs.modules.wrappers:port_allocator +pre-scm-buildstep = jenkins_jobs.modules.wrappers:pre_scm_buildstep +rbenv = jenkins_jobs.modules.wrappers:rbenv +release = jenkins_jobs.modules.wrappers:release rvm-env = jenkins_jobs.modules.wrappers:rvm_env +sauce-ondemand = jenkins_jobs.modules.wrappers:sauce_ondemand timeout = jenkins_jobs.modules.wrappers:timeout -env-file = jenkins_jobs.modules.wrappers:env_file -rbenv = jenkins_jobs.modules.wrappers:rbenv +timestamps = jenkins_jobs.modules.wrappers:timestamps +workspace-cleanup = jenkins_jobs.modules.wrappers:workspace_cleanup diff -Nru jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/PKG-INFO jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/PKG-INFO --- jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/PKG-INFO 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/PKG-INFO 2014-06-12 04:49:29.000000000 +0000 @@ -1,10 +1,90 @@ Metadata-Version: 1.0 Name: jenkins-job-builder -Version: 0.8.0 -Summary: UNKNOWN -Home-page: https://github.com/openstack-ci/jenkins-job-builder +Version: 0.8.1 +Summary: Manage Jenkins jobs with YAML +Home-page: https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder Author: OpenStack Infrastructure Team Author-email: openstack-infra@lists.openstack.org License: Apache License, Version 2.0 -Description: Manage Jenkins jobs with YAML +Description: =================== + Jenkins Job Builder + =================== + + Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML format, + and uses them to configure Jenkins. You can keep your job descriptions in human + readable text format in a version control system to make changes and auditing + easier. It also has a flexible template system, so creating many similarly + configured jobs is easy. + + To install:: + + $ sudo python setup.py install + + Online documentation: + + * http://ci.openstack.org/jenkins-job-builder/ + + Developers + ========== + Bug report: + + * https://bugs.launchpad.net/openstack-ci/ + + Cloning: + + * https://git.openstack.org/openstack-infra/jenkins-job-builder + + Patches are submitted via Gerrit at: + + * https://review.openstack.org/ + + Please do not submit GitHub pull requests, they will be automatically closed. + + More details on how you can contribute is available on our wiki at: + + * http://wiki.openstack.org/HowToContribute + + Writing a patch + =============== + + We ask that all code submissions be pep8_ and pyflakes_ clean. The + easiest way to do that is to run tox_ before submitting code for + review in Gerrit. It will run ``pep8`` and ``pyflakes`` in the same + manner as the automated test suite that will run on proposed + patchsets. + + When creating new YAML components, please observe the following style + conventions: + + * All YAML identifiers (including component names and arguments) + should be lower-case and multiple word identifiers should use + hyphens. E.g., "build-trigger". + * The Python functions that implement components should have the same + name as the YAML keyword, but should use underscores instead of + hyphens. E.g., "build_trigger". + + This consistency will help users avoid simple mistakes when writing + YAML, as well as developers when matching YAML components to Python + implementation. + + Installing without setup.py + =========================== + + For YAML support, you will need libyaml_ installed. + + Mac OS X:: + + $ brew install libyaml + + Then install the required python packages using pip_:: + + $ sudo pip install PyYAML python-jenkins + + .. _pep8: https://pypi.python.org/pypi/pep8 + .. _pyflakes: https://pypi.python.org/pypi/pyflakes + .. _tox: https://testrun.org/tox + .. _libyaml: http://pyyaml.org/wiki/LibYAML + .. _pip: https://pypi.python.org/pypi/pip + + Platform: UNKNOWN diff -Nru jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/requires.txt jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/requires.txt --- jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/requires.txt 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/requires.txt 2014-06-12 04:49:29.000000000 +0000 @@ -1,3 +1,3 @@ PyYAML python-jenkins -pbr>=0.5.21,<1.0 \ No newline at end of file +pbr>=0.8.2,<1.0 \ No newline at end of file diff -Nru jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/SOURCES.txt jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/SOURCES.txt --- jenkins-job-builder-0.8.0/jenkins_job_builder.egg-info/SOURCES.txt 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_job_builder.egg-info/SOURCES.txt 2014-06-12 04:49:29.000000000 +0000 @@ -70,10 +70,6 @@ jenkins_jobs/sphinx/__init__.py jenkins_jobs/sphinx/yaml.py samples/README.md -samples/gerrit-trigger.yaml -samples/pipeline.yaml -samples/release.yaml -samples/sonar.yaml tests/__init__.py tests/base.py tests/builders/__init__.py @@ -140,6 +136,10 @@ tests/general/fixtures/assigned-node001.yaml tests/general/fixtures/assigned-node002.xml tests/general/fixtures/assigned-node002.yaml +tests/general/fixtures/matrix-axis001.xml +tests/general/fixtures/matrix-axis001.yaml +tests/general/fixtures/matrix-axis002.xml +tests/general/fixtures/matrix-axis002.yaml tests/general/fixtures/project-maven001.xml tests/general/fixtures/project-maven001.yaml tests/general/fixtures/project-maven002.xml @@ -154,6 +154,16 @@ tests/general/fixtures/project-type004.yaml tests/general/fixtures/set-retry-count001.xml tests/general/fixtures/set-retry-count001.yaml +tests/macros/__init__.py +tests/macros/test_macros.py +tests/macros/scm/multi-scms001.xml +tests/macros/scm/multi-scms001.yaml +tests/macros/scm/multi-scms002.xml +tests/macros/scm/multi-scms002.yaml +tests/macros/scm/scm001.xml +tests/macros/scm/scm001.yaml +tests/macros/scm/scm002.xml +tests/macros/scm/scm002.yaml tests/notifications/__init__.py tests/notifications/test_notifications.py tests/notifications/fixtures/http-endpoint001.xml @@ -164,6 +174,8 @@ tests/parameters/fixtures/dynamic-choice-param001.yaml tests/properties/__init__.py tests/properties/test_properties.py +tests/properties/fixtures/authorization.xml +tests/properties/fixtures/authorization.yaml tests/properties/fixtures/batch-task.xml tests/properties/fixtures/batch-task.yaml tests/properties/fixtures/copyartifact.xml @@ -366,6 +378,10 @@ tests/yamlparser/fixtures/dont_overwrite_desc.yaml tests/yamlparser/fixtures/scm_remote_deep_bug.xml tests/yamlparser/fixtures/scm_remote_deep_bug.yaml +tests/yamlparser/fixtures/templates001.xml +tests/yamlparser/fixtures/templates001.yaml +tests/yamlparser/fixtures/templates002.xml +tests/yamlparser/fixtures/templates002.yaml tools/jenkins-jobs.py tools/run-compare-xml-samples.sh tools/run-compare-xml.sh diff -Nru jenkins-job-builder-0.8.0/jenkins_jobs/builder.py jenkins-job-builder-0.8.1/jenkins_jobs/builder.py --- jenkins-job-builder-0.8.0/jenkins_jobs/builder.py 2014-05-20 16:14:24.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_jobs/builder.py 2014-06-12 04:49:00.000000000 +0000 @@ -170,6 +170,9 @@ def applyDefaults(self, data): whichdefaults = data.get('defaults', 'global') defaults = self.data.get('defaults', {}).get(whichdefaults, {}) + if defaults == {} and whichdefaults != 'global': + raise JenkinsJobsException("Unknown defaults set: '{0}'" + .format(whichdefaults)) newdata = {} newdata.update(defaults) newdata.update(data) @@ -257,7 +260,17 @@ checksums = set([]) for values in itertools.product(*dimensions): params = copy.deepcopy(project) - params.update(values) + + expanded_values = {} + for (k, v) in values: + if isinstance(v, dict): + inner_key = v.iterkeys().next() + expanded_values[k] = inner_key + expanded_values.update(v[inner_key]) + else: + expanded_values[k] = v + + params.update(expanded_values) expanded = deep_format(template, params) # Keep track of the resulting expansions to avoid diff -Nru jenkins-job-builder-0.8.0/jenkins_jobs/modules/project_matrix.py jenkins-job-builder-0.8.1/jenkins_jobs/modules/project_matrix.py --- jenkins-job-builder-0.8.0/jenkins_jobs/modules/project_matrix.py 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_jobs/modules/project_matrix.py 2014-06-12 04:49:00.000000000 +0000 @@ -24,6 +24,13 @@ * user-defined values (``user-defined``) * slave name or label (``slave``) +The module supports also dynamic axis: + +* dynamic (``dynamic``) + +Requires the Jenkins `dynamic axis Plugin. +`_ + :Job Parameters: * **execution-strategy** (optional): * **combination-filter** (`str`): axes selection filter @@ -70,6 +77,11 @@ values: - node1 - node2 + - axis: + type: dynamic + name: config + values: + - config_list builders: - shell: make && make check @@ -103,6 +115,7 @@ 'label-expression': 'hudson.matrix.LabelExpAxis', 'user-defined': 'hudson.matrix.TextAxis', 'slave': 'hudson.matrix.LabelAxis', + 'dynamic': 'ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis', } def root_xml(self, data): @@ -143,7 +156,13 @@ name, values = axis['name'], axis['values'] XML.SubElement(lbl_root, 'name').text = str(name) v_root = XML.SubElement(lbl_root, 'values') - for v in values: - XML.SubElement(v_root, 'string').text = str(v) + if axis['type'] == "dynamic": + XML.SubElement(v_root, 'string').text = str(values[0]) + XML.SubElement(lbl_root, 'varName').text = str(values[0]) + v_root = XML.SubElement(lbl_root, 'axisValues') + XML.SubElement(v_root, 'string').text = 'default' + else: + for v in values: + XML.SubElement(v_root, 'string').text = str(v) return root diff -Nru jenkins-job-builder-0.8.0/jenkins_jobs/modules/properties.py jenkins-job-builder-0.8.1/jenkins_jobs/modules/properties.py --- jenkins-job-builder-0.8.0/jenkins_jobs/modules/properties.py 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_jobs/modules/properties.py 2014-06-12 04:49:00.000000000 +0000 @@ -28,7 +28,7 @@ properties: - github: - url: https://github.com/openstack-ci/jenkins-job-builder/ + url: https://github.com/openstack-infra/jenkins-job-builder/ """ @@ -136,7 +136,7 @@ properties: - github: - url: https://github.com/openstack-ci/jenkins-job-builder/ + url: https://github.com/openstack-infra/jenkins-job-builder/ """ github = XML.SubElement(xml_parent, 'com.coravy.hudson.plugins.github.' @@ -287,6 +287,7 @@ job-delete job-configure job-read + job-extended-read job-discover job-build job-workspace @@ -313,12 +314,14 @@ anonymous: - job-discover - job-read + - job-extended-read """ mapping = { 'job-delete': 'hudson.model.Item.Delete', 'job-configure': 'hudson.model.Item.Configure', 'job-read': 'hudson.model.Item.Read', + 'job-extended-read': 'hudson.model.Item.ExtendedRead', 'job-discover': 'hudson.model.Item.Discover', 'job-build': 'hudson.model.Item.Build', 'job-workspace': 'hudson.model.Item.Workspace', diff -Nru jenkins-job-builder-0.8.0/jenkins_jobs/modules/publishers.py jenkins-job-builder-0.8.1/jenkins_jobs/modules/publishers.py --- jenkins-job-builder-0.8.0/jenkins_jobs/modules/publishers.py 2014-05-20 16:14:24.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_jobs/modules/publishers.py 2014-06-12 04:49:00.000000000 +0000 @@ -1191,6 +1191,8 @@ (optional) :arg bool fail-on-error: fail the build if an error occurs (defaults to False). + :arg bool always-publish-from-master: transfer the files through the master + before being sent to the remote server (defaults to False) Example:: @@ -1722,7 +1724,8 @@ XML.SubElement(delegate, 'continueOnError').text = 'false' XML.SubElement(delegate, 'failOnError').text = \ str(data.get('fail-on-error', False)).lower() - XML.SubElement(delegate, 'alwaysPublishFromMaster').text = 'false' + XML.SubElement(delegate, 'alwaysPublishFromMaster').text = \ + str(data.get('always-publish-from-master', False)).lower() XML.SubElement(delegate, 'hostConfigurationAccess', {'class': reference_plugin_tag, 'reference': '../..'}) diff -Nru jenkins-job-builder-0.8.0/jenkins_jobs/modules/scm.py jenkins-job-builder-0.8.1/jenkins_jobs/modules/scm.py --- jenkins-job-builder-0.8.0/jenkins_jobs/modules/scm.py 2014-05-20 16:14:24.000000000 +0000 +++ jenkins-job-builder-0.8.1/jenkins_jobs/modules/scm.py 2014-06-12 04:49:00.000000000 +0000 @@ -18,14 +18,17 @@ project. It adds the ``scm`` attribute to the :ref:`Job` definition, which accepts any number of scm definitions. -Note: Adding more than one scm definition requires the Jenkins `Multiple -SCMs plugin. -`_ - **Component**: scm :Macro: scm :Entry Point: jenkins_jobs.scm +The scm module allows referencing multiple repositories in a Jenkins job. +Note: Adding more than one scm definition requires the Jenkins `Multiple +SCMs plugin. +`_ + +Example of multiple repositories in a single job: + .. literalinclude:: /../../tests/macros/scm/multi-scms001.yaml """ @@ -537,14 +540,16 @@ component_list_type = 'scm' def gen_xml(self, parser, xml_parent, data): - scms = data.get('scm', []) - if scms: - if len(scms) > 1: - class_name = 'org.jenkinsci.plugins.multiplescms.MultiSCM' - xml_attribs = {'class': class_name} - xml_parent = XML.SubElement(xml_parent, 'scm', xml_attribs) - xml_parent = XML.SubElement(xml_parent, 'scms') - for scm in data.get('scm', []): - self.registry.dispatch('scm', parser, xml_parent, scm) - else: + scms_parent = XML.Element('scms') + for scm in data.get('scm', []): + self.registry.dispatch('scm', parser, scms_parent, scm) + scms_count = len(scms_parent) + if scms_count == 0: XML.SubElement(xml_parent, 'scm', {'class': 'hudson.scm.NullSCM'}) + elif scms_count == 1: + xml_parent.append(scms_parent[0]) + else: + class_name = 'org.jenkinsci.plugins.multiplescms.MultiSCM' + xml_attribs = {'class': class_name} + xml_parent = XML.SubElement(xml_parent, 'scm', xml_attribs) + xml_parent.append(scms_parent) diff -Nru jenkins-job-builder-0.8.0/PKG-INFO jenkins-job-builder-0.8.1/PKG-INFO --- jenkins-job-builder-0.8.0/PKG-INFO 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/PKG-INFO 2014-06-12 04:49:29.000000000 +0000 @@ -1,10 +1,90 @@ Metadata-Version: 1.0 Name: jenkins-job-builder -Version: 0.8.0 -Summary: UNKNOWN -Home-page: https://github.com/openstack-ci/jenkins-job-builder +Version: 0.8.1 +Summary: Manage Jenkins jobs with YAML +Home-page: https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder Author: OpenStack Infrastructure Team Author-email: openstack-infra@lists.openstack.org License: Apache License, Version 2.0 -Description: Manage Jenkins jobs with YAML +Description: =================== + Jenkins Job Builder + =================== + + Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML format, + and uses them to configure Jenkins. You can keep your job descriptions in human + readable text format in a version control system to make changes and auditing + easier. It also has a flexible template system, so creating many similarly + configured jobs is easy. + + To install:: + + $ sudo python setup.py install + + Online documentation: + + * http://ci.openstack.org/jenkins-job-builder/ + + Developers + ========== + Bug report: + + * https://bugs.launchpad.net/openstack-ci/ + + Cloning: + + * https://git.openstack.org/openstack-infra/jenkins-job-builder + + Patches are submitted via Gerrit at: + + * https://review.openstack.org/ + + Please do not submit GitHub pull requests, they will be automatically closed. + + More details on how you can contribute is available on our wiki at: + + * http://wiki.openstack.org/HowToContribute + + Writing a patch + =============== + + We ask that all code submissions be pep8_ and pyflakes_ clean. The + easiest way to do that is to run tox_ before submitting code for + review in Gerrit. It will run ``pep8`` and ``pyflakes`` in the same + manner as the automated test suite that will run on proposed + patchsets. + + When creating new YAML components, please observe the following style + conventions: + + * All YAML identifiers (including component names and arguments) + should be lower-case and multiple word identifiers should use + hyphens. E.g., "build-trigger". + * The Python functions that implement components should have the same + name as the YAML keyword, but should use underscores instead of + hyphens. E.g., "build_trigger". + + This consistency will help users avoid simple mistakes when writing + YAML, as well as developers when matching YAML components to Python + implementation. + + Installing without setup.py + =========================== + + For YAML support, you will need libyaml_ installed. + + Mac OS X:: + + $ brew install libyaml + + Then install the required python packages using pip_:: + + $ sudo pip install PyYAML python-jenkins + + .. _pep8: https://pypi.python.org/pypi/pep8 + .. _pyflakes: https://pypi.python.org/pypi/pyflakes + .. _tox: https://testrun.org/tox + .. _libyaml: http://pyyaml.org/wiki/LibYAML + .. _pip: https://pypi.python.org/pypi/pip + + Platform: UNKNOWN diff -Nru jenkins-job-builder-0.8.0/requirements.txt jenkins-job-builder-0.8.1/requirements.txt --- jenkins-job-builder-0.8.0/requirements.txt 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/requirements.txt 2014-06-12 04:49:00.000000000 +0000 @@ -1,3 +1,3 @@ PyYAML python-jenkins -pbr>=0.5.21,<1.0 +pbr>=0.8.2,<1.0 diff -Nru jenkins-job-builder-0.8.0/samples/gerrit-trigger.yaml jenkins-job-builder-0.8.1/samples/gerrit-trigger.yaml --- jenkins-job-builder-0.8.0/samples/gerrit-trigger.yaml 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/samples/gerrit-trigger.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -- job: - name: test-gerrit-trigger - triggers: - - gerrit: - trigger-on-change-abandoned-event: true - trigger-on-change-merged-event: true - trigger-on-change-restored-event: true - trigger-on-comment-added-event: true - trigger-on-draft-published-event: true - trigger-on-patchset-uploaded-event: true - trigger-on-ref-updated-event: false - trigger-approval-category: CRVW - trigger-approval-value: 2 - failure-message: - skip-vote: - successful: true - failed: false - # Missing outcome should default to false. - # unstable: false - notbuilt: true - projects: - - project-compare-type: 'PLAIN' - project-pattern: 'myproject' - branch-compare-type: 'PLAIN' - branch-pattern: 'master' - file-paths: - - compare-type: ANT - pattern: subdirectory/** diff -Nru jenkins-job-builder-0.8.0/samples/pipeline.yaml jenkins-job-builder-0.8.1/samples/pipeline.yaml --- jenkins-job-builder-0.8.0/samples/pipeline.yaml 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/samples/pipeline.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -# Sample YAML representation of a flexible pipeline for use with the -# Jenkins Build Pipeline Plugin -# (https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin) -# The pipeline is defined at the project level, using job-specific variable -# substitution to specify the next job in the pipeline ('pipeline-next') -# for each job. -# -# This example defines the skeleton of two deployment pipelines: one for -# a 'base_os' subsystem to three chef servers, and the second to -# a 'database' subsystem to two chef servers. -# -# The pipeline uses an automatically-executed job in '{subsys}-prepare' -# (using the Parameterized Trigger Plugin - -# https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin), -# and manually-triggered jobs using the Pipeline publisher (e.g. -# '{subsys}-initialise'). -# -# Note how each project defines a different pipeline, with a different -# length, but re-uses the same job templates. - -- project: - name: deploy_base_os - subsys: base_os - jobs: - - '{subsys}-prepare': - pipeline-next: '{subsys}-initialise' - - '{subsys}-initialise': - pipeline-next: '{subsys}-upload-chef-server1' - - '{subsys}-upload-chef-server1': - pipeline-next: '{subsys}-upload-chef-server2' - - '{subsys}-upload-chef-server2': - pipeline-next: '{subsys}-upload-chef-server3' - - '{subsys}-upload-chef-server3': - pipeline-next: '' - -- project: - name: deploy_database - subsys: db - jobs: - - '{subsys}-prepare': - pipeline-next: '{subsys}-initialise' - - '{subsys}-initialise': - pipeline-next: '{subsys}-upload-chef-server1' - - '{subsys}-upload-chef-server1': - pipeline-next: '{subsys}-upload-chef-server2' - - '{subsys}-upload-chef-server2': - pipeline-next: '' - -- job-template: - name: '{subsys}-prepare' - builders: - - trigger-builds: - - project: '{pipeline-next}' - -- job-template: - name: '{subsys}-initialise' - publishers: - - pipeline: '{pipeline-next}' - -- job-template: - name: '{subsys}-upload-chef-server1' - publishers: - - pipeline: '{pipeline-next}' - -- job-template: - name: '{subsys}-upload-chef-server2' - publishers: - - pipeline: '{pipeline-next}' - -- job-template: - name: '{subsys}-upload-chef-server3' - publishers: - - pipeline: '{pipeline-next}' diff -Nru jenkins-job-builder-0.8.0/samples/README.md jenkins-job-builder-0.8.1/samples/README.md --- jenkins-job-builder-0.8.0/samples/README.md 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/samples/README.md 2014-06-12 04:49:00.000000000 +0000 @@ -1,8 +1,9 @@ # Jenkins Job Builder Examples # -These examples demonstrate the use of particular features of Jenkins -Job Builder that can be used as starting points for new projects. +Jenkins Job Builder includes many tests to demonstrate the use of Jenkins +Job Builder. All of the tests are in the 'tests' folder. It can be used +as a starting point for new projects. The tests also serve as JJB docs. -These examples are also used in the test framework - if you add a new -example here, please ensure that it can be processed by Jenkins Job -Builder. +Please look in the tests folder for examples of how to define yaml files +for use with JJB. Most of the test examples are snippets of yaml, for a +more complete example look at the tests in the 'tests/yamlparser' folder. diff -Nru jenkins-job-builder-0.8.0/samples/release.yaml jenkins-job-builder-0.8.1/samples/release.yaml --- jenkins-job-builder-0.8.0/samples/release.yaml 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/samples/release.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -- job: - name: 'test-release' - wrappers: - - release: - keep-forever: false - override-build-parameters: true - version-template: '${RELEASE_VERSION}' - parameters: - - string: - name: RELEASE_BRANCH - default: '' - description: 'The release branch to build' - pre-build: - - shell: | - #!/bin/bash - echo "echo pre-build builder" - post-build: - - shell: | - #!/bin/bash - echo "echo post-build builder" - post-success: - - shell: | - #!/bin/bash - echo "echo post-success builder" - post-fail: - - shell: | - #!/bin/bash - echo "echo post-fail builder" diff -Nru jenkins-job-builder-0.8.0/samples/sonar.yaml jenkins-job-builder-0.8.1/samples/sonar.yaml --- jenkins-job-builder-0.8.0/samples/sonar.yaml 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/samples/sonar.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -- job: - name: test-sonar - publishers: - - sonar: - jdk: MyJdk - branch: myBranch - language: java - maven-opts: -DskipTests - additional-properties: -DsonarHostURL=http://example.com/ - skip-global-triggers: - skip-when-scm-change: true - skip-when-upstream-build: true - skip-when-envvar-defined: SKIP_SONAR diff -Nru jenkins-job-builder-0.8.0/setup.cfg jenkins-job-builder-0.8.1/setup.cfg --- jenkins-job-builder-0.8.0/setup.cfg 2014-05-20 16:14:55.000000000 +0000 +++ jenkins-job-builder-0.8.1/setup.cfg 2014-06-12 04:49:29.000000000 +0000 @@ -7,9 +7,10 @@ name = jenkins-job-builder author = OpenStack Infrastructure Team author_email = openstack-infra@lists.openstack.org -description = Manage Jenkins jobs with YAML +summary = Manage Jenkins jobs with YAML +description-file = README.rst license = Apache License, Version 2.0 -home-page = https://github.com/openstack-ci/jenkins-job-builder +home-page = https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder classifiers = Environment :: Console Intended Audience :: Developers diff -Nru jenkins-job-builder-0.8.0/test-requirements.txt jenkins-job-builder-0.8.1/test-requirements.txt --- jenkins-job-builder-0.8.0/test-requirements.txt 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/test-requirements.txt 2014-06-12 04:49:00.000000000 +0000 @@ -1,4 +1,5 @@ hacking>=0.5.6,<0.8 +coverage>=3.6 discover fixtures python-subunit diff -Nru jenkins-job-builder-0.8.0/tests/base.py jenkins-job-builder-0.8.1/tests/base.py --- jenkins-job-builder-0.8.0/tests/base.py 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/base.py 2014-06-12 04:49:00.000000000 +0000 @@ -22,8 +22,10 @@ import os import re import doctest +import operator import testtools import xml.etree.ElementTree as XML +from ConfigParser import ConfigParser import yaml from jenkins_jobs.builder import XmlJob, YamlParser, ModuleRegistry from jenkins_jobs.modules import (project_flow, @@ -115,6 +117,43 @@ self.assertThat( pretty_xml, + testtools.matchers.DocTestMatches(expected_xml, + doctest.ELLIPSIS | + doctest.NORMALIZE_WHITESPACE | + doctest.REPORT_NDIFF) + ) + + +class SingleJobTestCase(BaseTestCase): + def test_yaml_snippet(self): + if not self.xml_filename or not self.yaml_filename: + return + + xml_filepath = os.path.join(self.fixtures_path, self.xml_filename) + expected_xml = u"%s" % open(xml_filepath, 'r').read() + + yaml_filepath = os.path.join(self.fixtures_path, self.yaml_filename) + + if self.conf_filename: + config = ConfigParser() + conf_filepath = os.path.join(self.fixtures_path, + self.conf_filename) + config.readfp(open(conf_filepath)) + else: + config = None + parser = YamlParser(config) + parser.parse(yaml_filepath) + + # Generate the XML tree + parser.generateXML() + + parser.jobs.sort(key=operator.attrgetter('name')) + + # Prettify generated XML + pretty_xml = "\n".join(job.output() for job in parser.jobs) + + self.assertThat( + pretty_xml, testtools.matchers.DocTestMatches(expected_xml, doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | diff -Nru jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis001.xml jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis001.xml --- jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis001.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis001.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,25 @@ + + + + false + + + + + config + + config_list + + config_list + + default + + + + + false + false + false + false + true + diff -Nru jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis001.yaml jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis001.yaml --- jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis001.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis001.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,8 @@ +name: matrix-test001 +project-type: matrix +axes: + - axis: + type: dynamic + name: config + values: + - config_list diff -Nru jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis002.xml jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis002.xml --- jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis002.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis002.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,32 @@ + + + + false + + + + + config + + config_list + + config_list + + default + + + + arch + + arm64 + amd64 + + + + + false + false + false + false + true + \ No newline at end of file diff -Nru jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis002.yaml jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis002.yaml --- jenkins-job-builder-0.8.0/tests/general/fixtures/matrix-axis002.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/general/fixtures/matrix-axis002.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,14 @@ +name: matrix-test002 +project-type: matrix +axes: + - axis: + type: dynamic + name: config + values: + - config_list + - axis: + type: user-defined + name: arch + values: + - arm64 + - amd64 diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms001.xml jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms001.xml --- jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms001.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms001.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,86 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + 2 + + + origin + +refs/heads/*:refs/remotes/origin/* + ssh://jenkins@review.openstack.org:29418/first.git + + + + + origin/master + + + + + false + false + false + false + false + true + false + false + Default + + + + + + false + + false + + + 2 + + + origin + +refs/heads/*:refs/remotes/origin/* + ssh://jenkins@review.openstack.org:29418/second.git + + + + + origin/master + + + + + false + false + false + false + false + true + false + false + Default + + + + + + false + + false + + + + + + + diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms001.yaml jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms001.yaml --- jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms001.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms001.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,26 @@ +- scm: + name: first-scm + scm: + - git: + url: ssh://jenkins@review.openstack.org:29418/first.git + branches: + - origin/master + +- scm: + name: second-scm + scm: + - git: + url: ssh://jenkins@review.openstack.org:29418/second.git + branches: + - origin/master + +- scm: + name: first-and-second + scm: + - first-scm + - second-scm + +- job: + name: my-job + scm: + - first-and-second diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms002.xml jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms002.xml --- jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms002.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms002.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,64 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + https://example.com/project/ + stable + repo.xml + drivers + build + https://internal.net/projects/repo + ~/git/project/ + 3 + false + false + + + 2 + + + origin + +refs/heads/*:refs/remotes/origin/* + ssh://jenkins@review.openstack.org:29418/second.git + + + + + origin/master + + + + + false + false + false + false + false + true + false + false + Default + + + + + + false + + false + + + + + + + diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms002.yaml jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms002.yaml --- jenkins-job-builder-0.8.0/tests/macros/scm/multi-scms002.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/multi-scms002.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,33 @@ +- scm: + name: first-scm + scm: + - repo: + manifest-url: https://example.com/project/ + manifest-branch: stable + manifest-file: repo.xml + manifest-group: drivers + destination-dir: build + repo-url: https://internal.net/projects/repo + mirror-dir: ~/git/project/ + jobs: 3 + current-branch: false + quiet: false + +- scm: + name: second-scm + scm: + - git: + url: ssh://jenkins@review.openstack.org:29418/second.git + branches: + - origin/master + +- scm: + name: first-and-second + scm: + - first-scm + - second-scm + +- job: + name: my-job + scm: + - first-and-second diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/scm001.xml jenkins-job-builder-0.8.1/tests/macros/scm/scm001.xml --- jenkins-job-builder-0.8.0/tests/macros/scm/scm001.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/scm001.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,15 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + + diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/scm001.yaml jenkins-job-builder-0.8.1/tests/macros/scm/scm001.yaml --- jenkins-job-builder-0.8.0/tests/macros/scm/scm001.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/scm001.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,3 @@ +- job: + name: my-job + scm: !!seq [] diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/scm002.xml jenkins-job-builder-0.8.1/tests/macros/scm/scm002.xml --- jenkins-job-builder-0.8.0/tests/macros/scm/scm002.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/scm002.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,48 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + 2 + + + origin + +refs/heads/*:refs/remotes/origin/* + ssh://jenkins@review.openstack.org:29418/repository.git + + + + + origin/master + + + + + false + false + false + false + false + true + false + false + Default + + + + + + false + + false + + + + + diff -Nru jenkins-job-builder-0.8.0/tests/macros/scm/scm002.yaml jenkins-job-builder-0.8.1/tests/macros/scm/scm002.yaml --- jenkins-job-builder-0.8.0/tests/macros/scm/scm002.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/scm/scm002.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,12 @@ +- scm: + name: repository + scm: + - git: + url: ssh://jenkins@review.openstack.org:29418/repository.git + branches: + - origin/master + +- job: + name: my-job + scm: + - repository diff -Nru jenkins-job-builder-0.8.0/tests/macros/test_macros.py jenkins-job-builder-0.8.1/tests/macros/test_macros.py --- jenkins-job-builder-0.8.0/tests/macros/test_macros.py 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/macros/test_macros.py 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,26 @@ +# Joint copyright: +# - Copyright 2012,2013 Wikimedia Foundation +# - Copyright 2012,2013 Antoine "hashar" Musso +# - Copyright 2013 Arnaud Fabre +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import os +from testtools import TestCase +from testscenarios.testcase import TestWithScenarios +from tests.base import get_scenarios, SingleJobTestCase + + +class TestCaseModuleSCMMacro(TestWithScenarios, TestCase, SingleJobTestCase): + fixtures_path = os.path.join(os.path.dirname(__file__), 'scm') + scenarios = get_scenarios(fixtures_path) diff -Nru jenkins-job-builder-0.8.0/tests/properties/fixtures/authorization.xml jenkins-job-builder-0.8.1/tests/properties/fixtures/authorization.xml --- jenkins-job-builder-0.8.0/tests/properties/fixtures/authorization.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/properties/fixtures/authorization.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + hudson.model.Item.Read:anonymous + hudson.model.Item.ExtendedRead:anonymous + + + diff -Nru jenkins-job-builder-0.8.0/tests/properties/fixtures/authorization.yaml jenkins-job-builder-0.8.1/tests/properties/fixtures/authorization.yaml --- jenkins-job-builder-0.8.0/tests/properties/fixtures/authorization.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/properties/fixtures/authorization.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,5 @@ +properties: + - authorization: + anonymous: + - job-read + - job-extended-read diff -Nru jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/scm_remote_deep_bug.yaml jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/scm_remote_deep_bug.yaml --- jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/scm_remote_deep_bug.yaml 2014-05-20 16:14:24.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/scm_remote_deep_bug.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -4,10 +4,6 @@ - git: url: 'http://example.org/' -- job: - name: 'scm_remote_deep_bug_job' - defaults: 'scm_remote_deep_bug_defs' - - job-template: name: 'scm_remote_deep_bug_tpl' defaults: 'scm_remote_deep_bug_defs' diff -Nru jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates001.xml jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates001.xml --- jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates001.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates001.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,50 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + perftest + + + + + projmanager@nowhere.net + false + false + + + + + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + unittest + + + + + developer@nowhere.net + false + false + + + + diff -Nru jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates001.yaml jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates001.yaml --- jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates001.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates001.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,23 @@ +- job-template: + name: '{name}-unit-tests' + builders: + - shell: unittest + publishers: + - email: + recipients: '{mail-to}' + +- job-template: + name: '{name}-perf-tests' + builders: + - shell: perftest + publishers: + - email: + recipients: '{mail-to}' + +- project: + name: project-name + jobs: + - '{name}-unit-tests': + mail-to: developer@nowhere.net + - '{name}-perf-tests': + mail-to: projmanager@nowhere.net diff -Nru jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates002.xml jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates002.xml --- jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates002.xml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates002.xml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,39 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + git co old_branch + + + + + + + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + git co new_branch + + + + + \ No newline at end of file diff -Nru jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates002.yaml jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates002.yaml --- jenkins-job-builder-0.8.0/tests/yamlparser/fixtures/templates002.yaml 1970-01-01 00:00:00.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/yamlparser/fixtures/templates002.yaml 2014-06-12 04:49:00.000000000 +0000 @@ -0,0 +1,14 @@ +- job-template: + name: '{name}-{pyver}' + builders: + - shell: 'git co {branch_name}' + +- project: + name: project-name + pyver: + - 26: + branch_name: old_branch + - 27: + branch_name: new_branch + jobs: + - '{name}-{pyver}' \ No newline at end of file diff -Nru jenkins-job-builder-0.8.0/tests/yamlparser/test_yamlparser.py jenkins-job-builder-0.8.1/tests/yamlparser/test_yamlparser.py --- jenkins-job-builder-0.8.0/tests/yamlparser/test_yamlparser.py 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/tests/yamlparser/test_yamlparser.py 2014-06-12 04:49:00.000000000 +0000 @@ -16,48 +16,12 @@ # under the License. import os -from ConfigParser import ConfigParser from testtools import TestCase from testscenarios.testcase import TestWithScenarios -from tests.base import get_scenarios, BaseTestCase -import doctest -import testtools -from jenkins_jobs.builder import YamlParser +from tests.base import get_scenarios, SingleJobTestCase -class TestCaseModuleYamlInclude(TestWithScenarios, TestCase, BaseTestCase): +class TestCaseModuleYamlInclude(TestWithScenarios, TestCase, + SingleJobTestCase): fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures') scenarios = get_scenarios(fixtures_path) - - def test_yaml_snippet(self): - if not self.xml_filename or not self.yaml_filename: - return - - xml_filepath = os.path.join(self.fixtures_path, self.xml_filename) - expected_xml = u"%s" % open(xml_filepath, 'r').read() - - yaml_filepath = os.path.join(self.fixtures_path, self.yaml_filename) - - if self.conf_filename: - config = ConfigParser() - conf_filepath = os.path.join(self.fixtures_path, - self.conf_filename) - config.readfp(open(conf_filepath)) - else: - config = None - parser = YamlParser(config) - parser.parse(yaml_filepath) - - # Generate the XML tree - parser.generateXML() - - # Prettify generated XML - pretty_xml = parser.jobs[0].output() - - self.assertThat( - pretty_xml, - testtools.matchers.DocTestMatches(expected_xml, - doctest.ELLIPSIS | - doctest.NORMALIZE_WHITESPACE | - doctest.REPORT_NDIFF) - ) diff -Nru jenkins-job-builder-0.8.0/tox.ini jenkins-job-builder-0.8.1/tox.ini --- jenkins-job-builder-0.8.0/tox.ini 2014-05-20 16:14:23.000000000 +0000 +++ jenkins-job-builder-0.8.1/tox.ini 2014-06-12 04:49:00.000000000 +0000 @@ -15,6 +15,13 @@ -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' +[testenv:cover] +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = + python setup.py test --coverage --coverage-package-name=jenkins_jobs + coverage report + [testenv:pep8] commands = flake8