jenkins-job-builder-0.5.0/0000775000175300017540000000000012160635107016507 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/setup.py0000664000175300017540000002161312160635010020215 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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 setuptools from jenkins_jobs.openstack.common import setup from jenkins_jobs.version import version_info as version requires = setup.parse_requirements() test_requires = setup.parse_requirements(['tools/test-requires']) depend_links = setup.parse_dependency_links() setuptools.setup( name='jenkins-job-builder', version=version.canonical_version_string(always=True), author='Hewlett-Packard Development Company, L.P.', author_email='openstack@lists.launchpad.net', description='Manage Jenkins jobs with YAML', license='Apache License, Version 2.0', url='https://github.com/openstack-ci/jenkins-job-builder', packages=setuptools.find_packages(exclude=['tests', 'tests.*']), include_package_data=True, cmdclass=setup.get_cmdclass(), install_requires=requires, dependency_links=depend_links, zip_safe=False, classifiers=[ 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Information Technology', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python' ], entry_points={ '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', 'matrix=jenkins_jobs.modules.project_matrix:Matrix', 'multijob=jenkins_jobs.modules.project_multijob:MultiJob', ], 'jenkins_jobs.builders': [ 'shell=jenkins_jobs.modules.builders:shell', 'ant=jenkins_jobs.modules.builders:ant', 'trigger-builds=jenkins_jobs.modules.builders:trigger_builds', 'builders-from=jenkins_jobs.modules.builders:builders_from', 'inject=jenkins_jobs.modules.builders:inject', 'artifact-resolver=jenkins_jobs.modules.builders:' 'artifact_resolver', 'copyartifact=jenkins_jobs.modules.builders:copyartifact', 'gradle=jenkins_jobs.modules.builders:gradle', 'batch=jenkins_jobs.modules.builders:batch', 'maven-target=jenkins_jobs.modules.builders:maven_target', 'multijob=jenkins_jobs.modules.builders:multijob', 'grails=jenkins_jobs.modules.builders:grails', 'conditional-step=jenkins_jobs.modules.builders:conditional_step', 'msbuild=jenkins_jobs.modules.builders:msbuild', ], 'jenkins_jobs.reporters': [ 'email=jenkins_jobs.modules.reporters:email', ], 'jenkins_jobs.properties': [ 'promoted-build=jenkins_jobs.modules.properties:promoted_build', 'github=jenkins_jobs.modules.properties:github', 'throttle=jenkins_jobs.modules.properties:throttle', 'inject=jenkins_jobs.modules.properties:inject', 'authenticated-build=jenkins_jobs.modules.properties:' 'authenticated_build', 'authorization=jenkins_jobs.modules.properties:authorization', 'extended-choice=jenkins_jobs.modules.properties:extended_choice', ], 'jenkins_jobs.parameters': [ 'string=jenkins_jobs.modules.parameters:string_param', 'password=jenkins_jobs.modules.parameters:password_param', 'bool=jenkins_jobs.modules.parameters:bool_param', 'file=jenkins_jobs.modules.parameters:file_param', 'text=jenkins_jobs.modules.parameters:text_param', 'label=jenkins_jobs.modules.parameters:label_param', 'choice=jenkins_jobs.modules.parameters:choice_param', 'validating-string=jenkins_jobs.modules.parameters:' 'validating_string_param', 'svn-tags=jenkins_jobs.modules.parameters:svn_tags_param', ], 'jenkins_jobs.notifications': [ 'http=jenkins_jobs.modules.notifications:http_endpoint', ], 'jenkins_jobs.publishers': [ 'archive=jenkins_jobs.modules.publishers:archive', 'trigger-parameterized-builds=' 'jenkins_jobs.modules.publishers:trigger_parameterized_builds', 'trigger=jenkins_jobs.modules.publishers:trigger', 'coverage=jenkins_jobs.modules.publishers:coverage', 'cobertura=jenkins_jobs.modules.publishers:cobertura', 'ftp=jenkins_jobs.modules.publishers:ftp', 'junit=jenkins_jobs.modules.publishers:junit', 'xunit=jenkins_jobs.modules.publishers:xunit', 'groovy-postbuild=jenkins_jobs.modules.publishers:' 'groovy_postbuild', 'violations=jenkins_jobs.modules.publishers:violations', 'checkstyle=jenkins_jobs.modules.publishers:checkstyle', 'scp=jenkins_jobs.modules.publishers:scp', 'ssh=jenkins_jobs.modules.publishers:ssh', 'pipeline=jenkins_jobs.modules.publishers:pipeline', 'email=jenkins_jobs.modules.publishers:email', 'claim-build=jenkins_jobs.modules.publishers:claim_build', 'email-ext=jenkins_jobs.modules.publishers:email_ext', 'fingerprint=jenkins_jobs.modules.publishers:fingerprint', 'aggregate-tests=jenkins_jobs.modules.publishers:aggregate_tests', 'cppcheck=jenkins_jobs.modules.publishers:cppcheck', 'logparser=jenkins_jobs.modules.publishers:logparser', 'copy-to-master=jenkins_jobs.modules.publishers:copy_to_master', 'jira=jenkins_jobs.modules.publishers:jira', 'cifs=jenkins_jobs.modules.publishers:cifs', 'sonar=jenkins_jobs.modules.publishers:sonar', 'performance=jenkins_jobs.modules.publishers:performance', 'join-trigger=jenkins_jobs.modules.publishers:join_trigger', 'jabber=jenkins_jobs.modules.publishers:jabber', 'workspace-cleanup=jenkins_jobs.modules.publishers:' 'workspace_cleanup', 'maven-deploy=jenkins_jobs.modules.publishers:maven_deploy', ], 'jenkins_jobs.scm': [ 'git=jenkins_jobs.modules.scm:git', 'svn=jenkins_jobs.modules.scm:svn', 'tfs=jenkins_jobs.modules.scm:tfs', ], 'jenkins_jobs.triggers': [ 'gerrit=jenkins_jobs.modules.triggers:gerrit', 'pollscm=jenkins_jobs.modules.triggers:pollscm', 'timed=jenkins_jobs.modules.triggers:timed', 'github=jenkins_jobs.modules.triggers:github', 'github-pull-request=jenkins_jobs.modules.triggers:' 'github_pull_request', ], 'jenkins_jobs.wrappers': [ 'timeout=jenkins_jobs.modules.wrappers:timeout', 'timestamps=jenkins_jobs.modules.wrappers:timestamps', 'ansicolor=jenkins_jobs.modules.wrappers:ansicolor', 'mask-passwords=jenkins_jobs.modules.wrappers:mask_passwords', 'build-name=jenkins_jobs.modules.wrappers:build_name', 'workspace-cleanup=jenkins_jobs.modules.wrappers:' 'workspace_cleanup', 'port-allocator=jenkins_jobs.modules.wrappers:port_allocator', 'locks=jenkins_jobs.modules.wrappers:locks', 'copy-to-slave=jenkins_jobs.modules.wrappers:copy_to_slave', 'inject=jenkins_jobs.modules.wrappers:inject', 'jclouds=jenkins_jobs.modules.wrappers:jclouds', 'build-user-vars=jenkins_jobs.modules.wrappers:build_user_vars', 'release=jenkins_jobs.modules.wrappers:release', ], 'jenkins_jobs.modules': [ 'general=jenkins_jobs.modules.general:General', 'builders=jenkins_jobs.modules.builders:Builders', 'properties=jenkins_jobs.modules.properties:Properties', 'parameters=jenkins_jobs.modules.parameters:Parameters', 'notifications=jenkins_jobs.modules.notifications:Notifications', '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', 'hipchat=jenkins_jobs.modules.hipchat_notif:HipChat', ] } ) jenkins-job-builder-0.5.0/samples/0000775000175300017540000000000012160635107020153 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/samples/README.md0000664000175300017540000000047512160635010021431 0ustar jenkinsjenkins00000000000000# 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. 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. jenkins-job-builder-0.5.0/samples/pipeline.yaml0000664000175300017540000000450212160635010022636 0ustar jenkinsjenkins00000000000000# 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}' jenkins-job-builder-0.5.0/samples/release.yaml0000664000175300017540000000150012160635010022444 0ustar jenkinsjenkins00000000000000- 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" jenkins-job-builder-0.5.0/samples/sonar.yaml0000664000175300017540000000064712160635010022161 0ustar jenkinsjenkins00000000000000- 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 jenkins-job-builder-0.5.0/samples/gerrit-trigger.yaml0000664000175300017540000000205712160635010023771 0ustar jenkinsjenkins00000000000000- 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/** jenkins-job-builder-0.5.0/openstack-common.conf0000664000175300017540000000023712160635010022626 0ustar jenkinsjenkins00000000000000[DEFAULT] # The list of modules to copy from openstack-common modules=setup,version # The base module to hold the copy of openstack.common base=jenkins_jobs jenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/0000775000175300017540000000000012160635107024202 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/SOURCES.txt0000664000175300017540000000416712160635107026076 0ustar jenkinsjenkins00000000000000AUTHORS ChangeLog LICENSE MANIFEST.in README.rst openstack-common.conf setup.cfg setup.py tox.ini doc/Makefile doc/source/builders.rst doc/source/conf.py doc/source/configuration.rst doc/source/extending.rst doc/source/general.rst doc/source/hipchat.rst doc/source/index.rst doc/source/installation.rst doc/source/notifications.rst doc/source/parameters.rst doc/source/project_freestyle.rst doc/source/project_matrix.rst doc/source/project_maven.rst doc/source/properties.rst doc/source/publishers.rst doc/source/reporters.rst doc/source/scm.rst doc/source/triggers.rst doc/source/wrappers.rst doc/source/zuul.rst etc/jenkins_jobs.ini-sample jenkins_job_builder.egg-info/PKG-INFO jenkins_job_builder.egg-info/SOURCES.txt jenkins_job_builder.egg-info/dependency_links.txt jenkins_job_builder.egg-info/entry_points.txt jenkins_job_builder.egg-info/not-zip-safe jenkins_job_builder.egg-info/requires.txt jenkins_job_builder.egg-info/top_level.txt jenkins_jobs/__init__.py jenkins_jobs/builder.py jenkins_jobs/cmd.py jenkins_jobs/errors.py jenkins_jobs/version.py jenkins_jobs/versioninfo jenkins_jobs/modules/__init__.py jenkins_jobs/modules/base.py jenkins_jobs/modules/builders.py jenkins_jobs/modules/general.py jenkins_jobs/modules/hipchat_notif.py jenkins_jobs/modules/notifications.py jenkins_jobs/modules/parameters.py jenkins_jobs/modules/project_freestyle.py jenkins_jobs/modules/project_matrix.py jenkins_jobs/modules/project_maven.py jenkins_jobs/modules/project_multijob.py jenkins_jobs/modules/properties.py jenkins_jobs/modules/publishers.py jenkins_jobs/modules/reporters.py jenkins_jobs/modules/scm.py jenkins_jobs/modules/triggers.py jenkins_jobs/modules/wrappers.py jenkins_jobs/modules/zuul.py jenkins_jobs/openstack/__init__.py jenkins_jobs/openstack/common/__init__.py jenkins_jobs/openstack/common/setup.py jenkins_jobs/openstack/common/version.py 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 tools/jenkins-jobs.py tools/pip-requires tools/run-compare-xml-samples.sh tools/run-compare-xml.sh tools/test-requires tools/test.shjenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/PKG-INFO0000664000175300017540000000115712160635106025302 0ustar jenkinsjenkins00000000000000Metadata-Version: 1.1 Name: jenkins-job-builder Version: 0.5.0 Summary: Manage Jenkins jobs with YAML Home-page: https://github.com/openstack-ci/jenkins-job-builder Author: Hewlett-Packard Development Company, L.P. Author-email: openstack@lists.launchpad.net License: Apache License, Version 2.0 Description: UNKNOWN Platform: UNKNOWN Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Information Technology Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python jenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/not-zip-safe0000664000175300017540000000000112160635012026423 0ustar jenkinsjenkins00000000000000 jenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/dependency_links.txt0000664000175300017540000000000112160635106030247 0ustar jenkinsjenkins00000000000000 jenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/top_level.txt0000664000175300017540000000001512160635106026727 0ustar jenkinsjenkins00000000000000jenkins_jobs jenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/requires.txt0000664000175300017540000000002512160635106026576 0ustar jenkinsjenkins00000000000000PyYAML python-jenkinsjenkins-job-builder-0.5.0/jenkins_job_builder.egg-info/entry_points.txt0000664000175300017540000001276412160635106027511 0ustar jenkinsjenkins00000000000000[jenkins_jobs.projects] freestyle = jenkins_jobs.modules.project_freestyle:Freestyle maven = jenkins_jobs.modules.project_maven:Maven multijob = jenkins_jobs.modules.project_multijob:MultiJob matrix = jenkins_jobs.modules.project_matrix:Matrix [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 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 [jenkins_jobs.triggers] timed = jenkins_jobs.modules.triggers:timed pollscm = jenkins_jobs.modules.triggers:pollscm github-pull-request = jenkins_jobs.modules.triggers:github_pull_request github = jenkins_jobs.modules.triggers:github gerrit = jenkins_jobs.modules.triggers:gerrit [jenkins_jobs.builders] maven-target = jenkins_jobs.modules.builders:maven_target shell = jenkins_jobs.modules.builders:shell trigger-builds = jenkins_jobs.modules.builders:trigger_builds grails = jenkins_jobs.modules.builders:grails batch = jenkins_jobs.modules.builders:batch gradle = jenkins_jobs.modules.builders:gradle ant = jenkins_jobs.modules.builders:ant artifact-resolver = jenkins_jobs.modules.builders:artifact_resolver msbuild = jenkins_jobs.modules.builders:msbuild inject = jenkins_jobs.modules.builders:inject conditional-step = jenkins_jobs.modules.builders:conditional_step builders-from = jenkins_jobs.modules.builders:builders_from multijob = jenkins_jobs.modules.builders:multijob copyartifact = jenkins_jobs.modules.builders:copyartifact [jenkins_jobs.notifications] http = jenkins_jobs.modules.notifications:http_endpoint [jenkins_jobs.properties] github = jenkins_jobs.modules.properties:github throttle = jenkins_jobs.modules.properties:throttle extended-choice = jenkins_jobs.modules.properties:extended_choice promoted-build = jenkins_jobs.modules.properties:promoted_build inject = jenkins_jobs.modules.properties:inject authenticated-build = jenkins_jobs.modules.properties:authenticated_build authorization = jenkins_jobs.modules.properties:authorization [jenkins_jobs.reporters] email = jenkins_jobs.modules.reporters:email [jenkins_jobs.publishers] jira = jenkins_jobs.modules.publishers:jira checkstyle = jenkins_jobs.modules.publishers:checkstyle claim-build = jenkins_jobs.modules.publishers:claim_build cobertura = jenkins_jobs.modules.publishers:cobertura 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 scp = jenkins_jobs.modules.publishers:scp ftp = jenkins_jobs.modules.publishers:ftp archive = jenkins_jobs.modules.publishers:archive copy-to-master = jenkins_jobs.modules.publishers:copy_to_master trigger = jenkins_jobs.modules.publishers:trigger 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 junit = jenkins_jobs.modules.publishers:junit cifs = jenkins_jobs.modules.publishers:cifs xunit = jenkins_jobs.modules.publishers:xunit pipeline = jenkins_jobs.modules.publishers:pipeline ssh = jenkins_jobs.modules.publishers:ssh aggregate-tests = jenkins_jobs.modules.publishers:aggregate_tests fingerprint = jenkins_jobs.modules.publishers:fingerprint trigger-parameterized-builds = jenkins_jobs.modules.publishers:trigger_parameterized_builds maven-deploy = jenkins_jobs.modules.publishers:maven_deploy email = jenkins_jobs.modules.publishers:email sonar = jenkins_jobs.modules.publishers:sonar logparser = jenkins_jobs.modules.publishers:logparser join-trigger = jenkins_jobs.modules.publishers:join_trigger [jenkins_jobs.scm] svn = jenkins_jobs.modules.scm:svn git = jenkins_jobs.modules.scm:git tfs = jenkins_jobs.modules.scm:tfs [console_scripts] jenkins-jobs = jenkins_jobs.cmd:main [jenkins_jobs.wrappers] timeout = jenkins_jobs.modules.wrappers:timeout copy-to-slave = jenkins_jobs.modules.wrappers:copy_to_slave build-user-vars = jenkins_jobs.modules.wrappers:build_user_vars jclouds = jenkins_jobs.modules.wrappers:jclouds locks = jenkins_jobs.modules.wrappers:locks ansicolor = jenkins_jobs.modules.wrappers:ansicolor workspace-cleanup = jenkins_jobs.modules.wrappers:workspace_cleanup build-name = jenkins_jobs.modules.wrappers:build_name port-allocator = jenkins_jobs.modules.wrappers:port_allocator release = jenkins_jobs.modules.wrappers:release timestamps = jenkins_jobs.modules.wrappers:timestamps mask-passwords = jenkins_jobs.modules.wrappers:mask_passwords inject = jenkins_jobs.modules.wrappers:inject [jenkins_jobs.parameters] 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 choice = jenkins_jobs.modules.parameters:choice_param label = jenkins_jobs.modules.parameters:label_param bool = jenkins_jobs.modules.parameters:bool_param file = jenkins_jobs.modules.parameters:file_param password = jenkins_jobs.modules.parameters:password_param jenkins-job-builder-0.5.0/etc/0000775000175300017540000000000012160635107017262 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/etc/jenkins_jobs.ini-sample0000664000175300017540000000014112160635010023705 0ustar jenkinsjenkins00000000000000[jenkins] user=jenkins password=1234567890abcdef1234567890abcdef url=https://jenkins.example.com jenkins-job-builder-0.5.0/tox.ini0000664000175300017540000000112412160635010020011 0ustar jenkinsjenkins00000000000000[tox] envlist = pep8, pyflakes [tox:jenkins] downloadcache = ~/cache/pip [testenv] deps = -r{toxinidir}/tools/pip-requires -r{toxinidir}/tools/test-requires [testenv:pep8] deps = pep8==1.3.3 commands = pep8 --repeat --show-source --ignore=E125 --exclude=.venv,.tox,dist,doc,build,*egg . [testenv:pyflakes] deps = pyflakes commands = pyflakes jenkins_jobs setup.py [testenv:compare-xml-old] commands = jenkins-jobs test -o .test/old/out/ .test/old/config/ [testenv:compare-xml-new] commands = jenkins-jobs test -o .test/new/out/ .test/new/config/ [testenv:venv] commands = {posargs} jenkins-job-builder-0.5.0/PKG-INFO0000664000175300017540000000115712160635107017610 0ustar jenkinsjenkins00000000000000Metadata-Version: 1.1 Name: jenkins-job-builder Version: 0.5.0 Summary: Manage Jenkins jobs with YAML Home-page: https://github.com/openstack-ci/jenkins-job-builder Author: Hewlett-Packard Development Company, L.P. Author-email: openstack@lists.launchpad.net License: Apache License, Version 2.0 Description: UNKNOWN Platform: UNKNOWN Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Information Technology Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python jenkins-job-builder-0.5.0/setup.cfg0000664000175300017540000000020712160635107020327 0ustar jenkinsjenkins00000000000000[build_sphinx] all_files = 1 build-dir = doc/build source-dir = doc/source [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 jenkins-job-builder-0.5.0/README.rst0000664000175300017540000000370612160635010020175 0ustar jenkinsjenkins00000000000000=================== 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://github.com/openstack-infra/jenkins-job-builder.git Patches are submitted via Gerrit at: * https://review.openstack.org/ 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 jenkins-job-builder-0.5.0/jenkins_jobs/0000775000175300017540000000000012160635107021165 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/modules/0000775000175300017540000000000012160635107022635 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/modules/builders.py0000664000175300017540000011244012160635010025013 0ustar jenkinsjenkins00000000000000# opyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2012 Varnish Software AS # # 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. """ Builders define actions that the Jenkins job should execute. Examples include shell scripts or maven targets. The ``builders`` attribute in the :ref:`Job` definition accepts a list of builders to invoke. They may be components defined below, locally defined macros (using the top level definition of ``builder:``, or locally defined components found via the ``jenkins_jobs.builders`` entry point. **Component**: builders :Macro: builder :Entry Point: jenkins_jobs.builders Example:: job: name: test_job builders: - shell: "make test" """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base import logging logger = logging.getLogger(__name__) def shell(parser, xml_parent, data): """yaml: shell Execute a shell command. :Parameter: the shell command to execute Example:: builders: - shell: "make test" """ shell = XML.SubElement(xml_parent, 'hudson.tasks.Shell') XML.SubElement(shell, 'command').text = data def copyartifact(parser, xml_parent, data): """yaml: copyartifact Copy artifact from another project. Requires the Jenkins `Copy Artifact plugin. `_ :arg str project: Project to copy from :arg str filter: what files to copy :arg str target: Target base directory for copy, blank means use workspace :arg bool flatten: Flatten directories (default: false) :arg str which-build: which build to get artifacts from (optional, default last-successful) :arg str build-number: specifies the build number to get when when specific-build is specified as which-build :arg str permalink: specifies the permalink to get when permalink is specified as which-build :arg bool stable: specifies to get only last stable build when last-successful is specified as which-build :arg bool fallback-to-last-successful: specifies to fallback to last successful build when upstream-build is specified as which-build :arg string param: specifies to use a build parameter to get the build when build-param is specified as which-build :which-build values: * **last-successful** * **specific-build** * **last-saved** * **upstream-build** * **permalink** * **workspace-latest** * **build-param** :permalink values: * **last** * **last-stable** * **last-successful** * **last-failed** * **last-unstable** * **last-unsuccessful** Example:: builders: - copyartifact: project: foo filter: *.tar.gz target: /home/foo which-build: specific-build build-number: 123 flatten: true """ t = XML.SubElement(xml_parent, 'hudson.plugins.copyartifact.CopyArtifact') #'project' element is used for copy artifact version 1.26+ XML.SubElement(t, 'project').text = data["project"] #'projectName' element is used for copy artifact version 1.25- XML.SubElement(t, 'projectName').text = data["project"] XML.SubElement(t, 'filter').text = data.get("filter", "") XML.SubElement(t, 'target').text = data.get("target", "") flatten = data.get("flatten", False) XML.SubElement(t, 'flatten').text = str(flatten).lower() select = data.get('which-build', 'last-successful') selectdict = {'last-successful': 'StatusBuildSelector', 'specific-build': 'SpecificBuildSelector', 'last-saved': 'SavedBuildSelector', 'upstream-build': 'TriggeredBuildSelector', 'permalink': 'PermalinkBuildSelector', 'workspace-latest': 'WorkspaceSelector', 'build-param': 'ParameterizedBuildSelector'} if select not in selectdict: raise Exception("which-build entered is not valid must be one of: " + "last-successful, specific-build, last-saved, " + "upstream-build, permalink, workspace-latest, " + " or build-param") permalink = data.get('permalink', 'last') permalinkdict = {'last': 'lastBuild', 'last-stable': 'lastStableBuild', 'last-successful': 'lastSuccessfulBuild', 'last-failed': 'lastFailedBuild', 'last-unstable': 'lastUnstableBuild', 'last-unsuccessful': 'lastUnsuccessfulBuild'} if permalink not in permalinkdict: raise Exception("permalink entered is not valid must be one of: " + "last, last-stable, last-successful, last-failed, " + "last-unstable, or last-unsuccessful") selector = XML.SubElement(t, 'selector', {'class': 'hudson.plugins.copyartifact.' + selectdict[select]}) if select == 'specific-build': XML.SubElement(selector, 'buildNumber').text = data['build-number'] if select == 'last-successful': XML.SubElement(selector, 'stable').text = str( data.get('stable', 'false')).lower() if select == 'upstream-build': XML.SubElement(selector, 'fallbackToLastSuccessful').text = str( data.get('fallback-to-last-successful', 'false')).lower() if select == 'permalink': XML.SubElement(selector, 'id').text = permalinkdict[permalink] if select == 'build-param': XML.SubElement(selector, 'parameterName').text = data['param'] def ant(parser, xml_parent, data): """yaml: ant Execute an ant target. Requires the Jenkins `Ant Plugin. `_ To setup this builder you can either reference the list of targets or use named parameters. Below is a description of both forms: *1) Listing targets:* After the ant directive, simply pass as argument a space separated list of targets to build. :Parameter: space separated list of Ant targets :arg str ant-name: the name of the ant installation, defaults to 'default' (optional) Example to call two Ant targets:: builders: - ant: "target1 target2" ant-name: "Standard Ant" The build file would be whatever the Jenkins Ant Plugin is set to use per default (i.e build.xml in the workspace root). *2) Using named parameters:* :arg str targets: the space separated list of ANT targets. :arg str buildfile: the path to the ANT build file. :arg list properties: Passed to ant script using -Dkey=value (optional) :arg str ant-name: the name of the ant installation, defaults to 'default' (optional) :arg str java-opts: java options for ant, can have multiples, must be in quotes (optional) Example specifying the build file too and several targets:: builders: - ant: targets: "debug test install" buildfile: "build.xml" properties: builddir: "/tmp/" failonerror: true java-opts: - "-ea" - "-Xmx512m" ant-name: "Standard Ant" """ ant = XML.SubElement(xml_parent, 'hudson.tasks.Ant') if type(data) is str: # Support for short form: -ant: "target" data = {'targets': data} for setting, value in data.iteritems(): if setting == 'targets': targets = XML.SubElement(ant, 'targets') targets.text = value if setting == 'buildfile': buildfile = XML.SubElement(ant, 'buildFile') buildfile.text = value if setting == 'properties': properties = data['properties'] prop_string = '' for prop, val in properties.items(): prop_string += "%s=%s\n" % (prop, val) prop_element = XML.SubElement(ant, 'properties') prop_element.text = prop_string if setting == 'java-opts': javaopts = data['java-opts'] jopt_string = ' '.join(javaopts) jopt_element = XML.SubElement(ant, 'antOpts') jopt_element.text = jopt_string XML.SubElement(ant, 'antName').text = data.get('ant-name', 'default') def trigger_builds(parser, xml_parent, data): """yaml: trigger-builds Trigger builds of other jobs. Requires the Jenkins `Parameterized Trigger Plugin. `_ :arg str project: the Jenkins project to trigger :arg str predefined-parameters: key/value pairs to be passed to the job (optional) :arg bool current-parameters: Whether to include the parameters passed to the current build to the triggered job. :arg bool svn-revision: Whether to pass the svn revision to the triggered job :arg bool block: whether to wait for the triggered jobs to finish or not (default false) Example:: builders: - trigger-builds: - project: "build_started" predefined-parameters: FOO="bar" block: true """ tbuilder = XML.SubElement(xml_parent, 'hudson.plugins.parameterizedtrigger.' 'TriggerBuilder') configs = XML.SubElement(tbuilder, 'configs') for project_def in data: if 'project' not in project_def or project_def['project'] == '': logger.debug("No project specified - skipping trigger-build") continue tconfig = XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.' 'BlockableBuildTriggerConfig') tconfigs = XML.SubElement(tconfig, 'configs') if(project_def.get('current-parameters')): XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'CurrentBuildParameters') if(project_def.get('svn-revision')): XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'SubversionRevisionBuildParameters') if 'predefined-parameters' in project_def: params = XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'PredefinedBuildParameters') properties = XML.SubElement(params, 'properties') properties.text = project_def['predefined-parameters'] if(len(list(tconfigs)) == 0): tconfigs.set('class', 'java.util.Collections$EmptyList') projects = XML.SubElement(tconfig, 'projects') projects.text = project_def['project'] condition = XML.SubElement(tconfig, 'condition') condition.text = 'ALWAYS' trigger_with_no_params = XML.SubElement(tconfig, 'triggerWithNoParameters') trigger_with_no_params.text = 'false' build_all_nodes_with_label = XML.SubElement(tconfig, 'buildAllNodesWithLabel') build_all_nodes_with_label.text = 'false' block = project_def.get('block', False) if(block): block = XML.SubElement(tconfig, 'block') bsft = XML.SubElement(block, 'buildStepFailureThreshold') XML.SubElement(bsft, 'name').text = 'FAILURE' XML.SubElement(bsft, 'ordinal').text = '2' XML.SubElement(bsft, 'color').text = 'RED' ut = XML.SubElement(block, 'unstableThreshold') XML.SubElement(ut, 'name').text = 'UNSTABLE' XML.SubElement(ut, 'ordinal').text = '1' XML.SubElement(ut, 'color').text = 'Yellow' ft = XML.SubElement(block, 'failureThreshold') XML.SubElement(ft, 'name').text = 'FAILURE' XML.SubElement(ft, 'ordinal').text = '2' XML.SubElement(ft, 'color').text = 'RED' # If configs is empty, remove the entire tbuilder tree. if(len(configs) == 0): logger.debug("Pruning empty TriggerBuilder tree.") xml_parent.remove(tbuilder) def builders_from(parser, xml_parent, data): """yaml: builders-from Use builders from another project. Requires the Jenkins `Template Project Plugin. `_ :arg str projectName: the name of the other project Example:: builders: - builders-from: - project: "base-build" """ pbs = XML.SubElement(xml_parent, 'hudson.plugins.templateproject.ProxyBuilder') XML.SubElement(pbs, 'projectName').text = data def inject(parser, xml_parent, data): """yaml: inject Inject an environment for the job. Requires the Jenkins `EnvInject Plugin. `_ :arg str properties-file: the name of the property file (optional) :arg str properties-content: the properties content (optional) Example:: builders: - inject: properties-file: example.prop properties-content: EXAMPLE=foo-bar """ eib = XML.SubElement(xml_parent, 'EnvInjectBuilder') info = XML.SubElement(eib, 'info') jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'propertiesFilePath', data.get('properties-file')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'propertiesContent', data.get('properties-content')) def artifact_resolver(parser, xml_parent, data): """yaml: artifact-resolver Allows one to resolve artifacts from a maven repository like nexus (without having maven installed) Requires the Jenkins `Repository Connector Plugin `_ :arg bool fail-on-error: Whether to fail the build on error (default false) :arg bool repository-logging: Enable repository logging (default false) :arg str target-directory: Where to resolve artifacts to :arg list artifacts: list of artifacts to resolve :Artifact: * **group-id** (`str`) -- Group ID of the artifact * **artifact-id** (`str`) -- Artifact ID of the artifact * **version** (`str`) -- Version of the artifact * **classifier** (`str`) -- Classifier of the artifact (default '') * **extension** (`str`) -- Extension of the artifact (default 'jar') * **target-file-name** (`str`) -- What to name the artifact (default '') Example:: builders: - artifact-resolver: fail-on-error: true repository-logging: true target-directory: foo artifacts: - group-id: commons-logging artifact-id: commons-logging version: 1.1 classifier: src extension: jar target-file-name: comm-log.jar - group-id: commons-lang artifact-id: commons-lang version: 1.2 """ ar = XML.SubElement(xml_parent, 'org.jvnet.hudson.plugins.repositoryconnector.' 'ArtifactResolver') XML.SubElement(ar, 'targetDirectory').text = data['target-directory'] artifacttop = XML.SubElement(ar, 'artifacts') artifacts = data['artifacts'] for artifact in artifacts: rcartifact = XML.SubElement(artifacttop, 'org.jvnet.hudson.plugins.' 'repositoryconnector.Artifact') XML.SubElement(rcartifact, 'groupId').text = artifact['group-id'] XML.SubElement(rcartifact, 'artifactId').text = artifact['artifact-id'] XML.SubElement(rcartifact, 'classifier').text = artifact.get( 'classifier', '') XML.SubElement(rcartifact, 'version').text = artifact['version'] XML.SubElement(rcartifact, 'extension').text = artifact.get( 'extension', 'jar') XML.SubElement(rcartifact, 'targetFileName').text = artifact.get( 'target-file-name', '') XML.SubElement(ar, 'failOnError').text = str(data.get( 'fail-on-error', False)).lower() XML.SubElement(ar, 'enableRepoLogging').text = str(data.get( 'repository-logging', False)).lower() XML.SubElement(ar, 'snapshotUpdatePolicy').text = 'never' XML.SubElement(ar, 'releaseUpdatePolicy').text = 'never' XML.SubElement(ar, 'snapshotChecksumPolicy').text = 'warn' XML.SubElement(ar, 'releaseChecksumPolicy').text = 'warn' def gradle(parser, xml_parent, data): """yaml: gradle Execute gradle tasks. Requires the Jenkins `Gradle Plugin. `_ :arg str tasks: List of tasks to execute :arg str gradle-name: Use a custom gradle name (optional) :arg bool wrapper: use gradle wrapper (default false) :arg bool executable: make gradlew executable (default false) :arg list switches: Switches for gradle, can have multiples Example:: builders: - gradle: gradle-name: "gradle-1.2" wrapper: true executable: true switches: - "-g /foo/bar/.gradle" - "-PmavenUserName=foobar" tasks: | init build tests """ gradle = XML.SubElement(xml_parent, 'hudson.plugins.gradle.Gradle') XML.SubElement(gradle, 'description').text = '' XML.SubElement(gradle, 'tasks').text = data['tasks'] XML.SubElement(gradle, 'rootBuildScriptDir').text = '' XML.SubElement(gradle, 'buildFile').text = '' XML.SubElement(gradle, 'gradleName').text = data.get( 'gradle-name', '') XML.SubElement(gradle, 'useWrapper').text = str(data.get( 'wrapper', False)).lower() XML.SubElement(gradle, 'makeExecutable').text = str(data.get( 'executable', False)).lower() switch_string = '\n'.join(data.get('switches', [])) XML.SubElement(gradle, 'switches').text = switch_string def batch(parser, xml_parent, data): """yaml: batch Execute a batch command. :Parameter: the batch command to execute Example:: builders: - batch: "foo/foo.bat" """ batch = XML.SubElement(xml_parent, 'hudson.tasks.BatchFile') XML.SubElement(batch, 'command').text = data def msbuild(parser, xml_parent, data): """yaml: msbuild Build .NET project using msbuild. Requires the `Jenkins MSBuild Plugin `_. :arg str msbuild-version: which msbuild configured in Jenkins to use (optional) :arg str solution-file: location of the solution file to build :arg str extra-parameters: extra parameters to pass to msbuild (optional) :arg bool pass-build-variables: should build variables be passed to msbuild (defaults to true) :arg bool continue-on-build-failure: should the build continue if msbuild returns an error (defaults to false) Example:: builders: - msbuild: solution-file: "MySolution.sln" msbuild-version: "msbuild-4.0" extra-parameters: "/maxcpucount:4" pass-build-variables: False continue-on-build-failure: True """ msbuilder = XML.SubElement(xml_parent, 'hudson.plugins.msbuild.MsBuildBuilder') XML.SubElement(msbuilder, 'msBuildName').text = data.get('msbuild-version', '(Default)') XML.SubElement(msbuilder, 'msBuildFile').text = data['solution-file'] XML.SubElement(msbuilder, 'cmdLineArgs').text = \ data.get('extra-parameters', '') XML.SubElement(msbuilder, 'buildVariablesAsProperties').text = \ str(data.get('pass-build-variables', True)).lower() XML.SubElement(msbuilder, 'continueOnBuildFailure').text = \ str(data.get('continue-on-build-failure', False)).lower() def create_builders(parser, step): dummy_parent = XML.Element("dummy") parser.registry.dispatch('builder', parser, dummy_parent, step) return list(dummy_parent) def conditional_step(parser, xml_parent, data): """yaml: conditional-step Conditionaly execute some build steps. Requires the Jenkins `Conditional BuildStep Plugin`_. Depending on the number of declared steps, a `Conditional step (single)` or a `Conditional steps (multiple)` is created in Jenkins. :arg str condition-kind: Condition kind that must be verified before the steps are executed. Valid values and their additional attributes are described in the conditions_ table. :arg str on-evaluation-failure: What should be the outcome of the build if the evaluation of the condition fails. Possible values are `fail`, `mark-unstable`, `run-and-mark-unstable`, `run` and `dont-run`. Default is `fail`. :arg list steps: List of steps to run if the condition is verified. Items in the list can be any builder known by Jenkins Job Builder. .. _conditions: ================== ==================================================== Condition kind Description ================== ==================================================== always Condition is always verified never Condition is never verified boolean-expression Run the step if the expression expends to a representation of true :condition-expression: Expression to expand current-status Run the build step if the current build status is within the configured range :condition-worst: Worst status :condition-best: Best status shell Run the step if the shell command succeed :condition-command: Shell command to execute windows-shell Similar to shell, except that commands will be executed by cmd, under Windows :condition-command: Command to execute file-exists Run the step if a file exists :condition-filename: Check existence of this file :condition-basedir: If condition-filename is relative, it will be considered relative to either `workspace`, `artifact-directory`, or `jenkins-home`. Default is `workspace`. ================== ==================================================== Example:: builders: - conditional-step: condition-kind: boolean-expression condition-expression: "${ENV,var=IS_STABLE_BRANCH}" on-evaluation-failure: mark-unstable steps: - shell: "echo Making extra checks" .. _Conditional BuildStep Plugin: https://wiki.jenkins-ci.org/display/ JENKINS/Conditional+BuildStep+Plugin """ def build_condition(cdata): kind = cdata['condition-kind'] ctag = XML.SubElement(root_tag, condition_tag) if kind == "always": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.core.AlwaysRun') elif kind == "never": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.core.NeverRun') elif kind == "boolean-expression": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.core.' 'BooleanCondition') XML.SubElement(ctag, "token").text = cdata['condition-expression'] elif kind == "current-status": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.core.' 'StatusCondition') wr = XML.SubElement(ctag, 'worstResult') XML.SubElement(wr, "name").text = cdata['condition-worst'] br = XML.SubElement(ctag, 'bestResult') XML.SubElement(br, "name").text = cdata['condition-best'] elif kind == "shell": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.contributed.' 'ShellCondition') XML.SubElement(ctag, "command").text = cdata['condition-command'] elif kind == "windows-shell": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.contributed.' 'BatchFileCondition') XML.SubElement(ctag, "command").text = cdata['condition-command'] elif kind == "file-exists": ctag.set('class', 'org.jenkins_ci.plugins.run_condition.core.' 'FileExistsCondition') XML.SubElement(ctag, "file").text = cdata['condition-filename'] basedir = cdata.get('condition-basedir', 'workspace') basedir_tag = XML.SubElement(ctag, "baseDir") if "workspace" == basedir: basedir_tag.set('class', 'org.jenkins_ci.plugins.run_condition.common.' 'BaseDirectory$Workspace') elif "artifact-directory" == basedir: basedir_tag.set('class', 'org.jenkins_ci.plugins.run_condition.common.' 'BaseDirectory$ArtifactsDir') elif "jenkins-home" == basedir: basedir_tag.set('class', 'org.jenkins_ci.plugins.run_condition.common.' 'BaseDirectory$JenkinsHome') def build_step(parent, step): for edited_node in create_builders(parser, step): if not has_multiple_steps: edited_node.set('class', edited_node.tag) edited_node.tag = 'buildStep' parent.append(edited_node) cond_builder_tag = 'org.jenkinsci.plugins.conditionalbuildstep.' \ 'singlestep.SingleConditionalBuilder' cond_builders_tag = 'org.jenkinsci.plugins.conditionalbuildstep.' \ 'ConditionalBuilder' steps = data['steps'] has_multiple_steps = len(steps) > 1 if has_multiple_steps: root_tag = XML.SubElement(xml_parent, cond_builders_tag) steps_parent = XML.SubElement(root_tag, "conditionalbuilders") condition_tag = "runCondition" else: root_tag = XML.SubElement(xml_parent, cond_builder_tag) steps_parent = root_tag condition_tag = "condition" build_condition(data) evaluation_classes_pkg = 'org.jenkins_ci.plugins.run_condition' evaluation_classes = { 'fail': evaluation_classes_pkg + '.BuildStepRunner$Fail', 'mark-unstable': evaluation_classes_pkg + '.BuildStepRunner$Unstable', 'run-and-mark-unstable': evaluation_classes_pkg + 'BuildStepRunner$RunUnstable', 'run': evaluation_classes_pkg + '.BuildStepRunner$Run', 'dont-run': evaluation_classes_pkg + 'BuildStepRunner$DontRun', } evaluation_class = evaluation_classes[data.get('on-evaluation-failure', 'fail')] XML.SubElement(root_tag, "runner").set('class', evaluation_class) for step in steps: build_step(steps_parent, step) def maven_target(parser, xml_parent, data): """yaml: maven-target Execute top-level Maven targets :arg str goals: Goals to execute :arg str properties: Properties for maven, can have multiples :arg str pom: Location of pom.xml (defaults to pom.xml) :arg str maven-version: Installation of maven which should be used (optional) Example:: builders: - maven-target: maven-version: Maven3 pom: parent/pom.xml goals: clean properties: - foo=bar - bar=foo """ maven = XML.SubElement(xml_parent, 'hudson.tasks.Maven') XML.SubElement(maven, 'targets').text = data['goals'] prop_string = '\n'.join(data.get('properties', [])) XML.SubElement(maven, 'properties').text = prop_string if 'maven-version' in data: XML.SubElement(maven, 'mavenName').text = str(data['maven-version']) if 'pom' in data: XML.SubElement(maven, 'pom').text = str(data['pom']) XML.SubElement(maven, 'usePrivateRepository').text = 'false' XML.SubElement(maven, 'settings', { 'class': 'jenkins.mvn.DefaultSettingsProvider'}) XML.SubElement(maven, 'globalSettings', { 'class': 'jenkins.mvn.DefaultGlobalSettingsProvider'}) def multijob(parser, xml_parent, data): """yaml: multijob Define a multijob phase. Requires the Jenkins `Multijob Plugin. `_ This builder may only be used in \ :py:class:`jenkins_jobs.modules.project_multijob.MultiJob` projects. :arg str name: MultiJob phase name :arg str condition: when to trigger the other job (default 'SUCCESSFUL') :arg list projects: list of projects to include in the MultiJob phase :Project: * **name** (`str`) -- Project name * **current-parameters** (`bool`) -- Pass current build parameters to the other job (default false) * **git-revision** (`bool`) -- Pass current git-revision to the other job (default false) * **property-file** (`str`) -- Pass properties from file to the other job (optional) * **predefined-parameters** (`str`) -- Pass predefined parameters to the other job (optional) Example:: builders: - multijob: name: PhaseOne condition: SUCCESSFUL projects: - name: PhaseOneJobA current-parameters: true git-revision: true - name: PhaseOneJobB current-parameters: true property-file: build.props - multijob: name: PhaseTwo condition: UNSTABLE projects: - name: PhaseTwoJobA current-parameters: true predefined-parameters: foo=bar - name: PhaseTwoJobB current-parameters: false """ builder = XML.SubElement(xml_parent, 'com.tikal.jenkins.plugins.multijob.' 'MultiJobBuilder') XML.SubElement(builder, 'phaseName').text = data['name'] condition = data.get('condition', 'SUCCESSFUL') XML.SubElement(builder, 'continuationCondition').text = condition phaseJobs = XML.SubElement(builder, 'phaseJobs') for project in data.get('projects', []): phaseJob = XML.SubElement(phaseJobs, 'com.tikal.jenkins.plugins.' 'multijob.PhaseJobsConfig') XML.SubElement(phaseJob, 'jobName').text = project['name'] # Pass through the current build params currParams = str(project.get('current-parameters', False)).lower() XML.SubElement(phaseJob, 'currParams').text = currParams # Pass through other params configs = XML.SubElement(phaseJob, 'configs') # Git Revision if project.get('git-revision', False): param = XML.SubElement(configs, 'hudson.plugins.git.' 'GitRevisionBuildParameters') combine = XML.SubElement(param, 'combineQueuedCommits') combine.text = 'false' # Properties File properties_file = project.get('property-file', False) if properties_file: param = XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.' 'FileBuildParameters') propertiesFile = XML.SubElement(param, 'propertiesFile') propertiesFile.text = properties_file failOnMissing = XML.SubElement(param, 'failTriggerOnMissing') failOnMissing.text = 'true' # Predefined Parameters predefined_parameters = project.get('predefined-parameters', False) if predefined_parameters: param = XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.' 'PredefinedBuildParameters') properties = XML.SubElement(param, 'properties') properties.text = predefined_parameters def grails(parser, xml_parent, data): """yaml: grails Execute a grails build step. Requires the `Jenkins Grails Plugin. `_ :arg bool use-wrapper: Use a grails wrapper (default false) :arg str name: Select a grails installation to use (optional) :arg bool force-upgrade: Run 'grails upgrade --non-interactive' first (default false) :arg bool non-interactive: append --non-interactive to all build targets (default false) :arg str targets: Specify target(s) to run separated by spaces :arg str server-port: Specify a value for the server.port system property (optional) :arg str work-dir: Specify a value for the grails.work.dir system property (optional) :arg str project-dir: Specify a value for the grails.project.work.dir system property (optional) :arg str base-dir: Specify a path to the root of the Grails project (optional) :arg str properties: Additional system properties to set (optional) :arg bool plain-output: append --plain-output to all build targets (default false) :arg bool stack-trace: append --stack-trace to all build targets (default false) :arg bool verbose: append --verbose to all build targets (default false) :arg bool refresh-dependencies: append --refresh-dependencies to all build targets (default false) Example:: builders: - grails: use-wrapper: "true" name: "grails-2.2.2" force-upgrade: "true" non-interactive: "true" targets: "war ear" server-port: "8003" work-dir: "./grails-work" project-dir: "./project-work" base-dir: "./grails/project" properties: "program.name=foo" plain-output: "true" stack-trace: "true" verbose: "true" refresh-dependencies: "true" """ grails = XML.SubElement(xml_parent, 'com.g2one.hudson.grails.' 'GrailsBuilder') XML.SubElement(grails, 'targets').text = data['targets'] XML.SubElement(grails, 'name').text = data.get( 'name', '(Default)') XML.SubElement(grails, 'grailsWorkDir').text = data.get( 'work-dir', '') XML.SubElement(grails, 'projectWorkDir').text = data.get( 'project-dir', '') XML.SubElement(grails, 'projectBaseDir').text = data.get( 'base-dir', '') XML.SubElement(grails, 'serverPort').text = data.get( 'server-port', '') XML.SubElement(grails, 'properties').text = data.get( 'properties', '') XML.SubElement(grails, 'forceUpgrade').text = str( data.get('force-upgrade', 'false')).lower() XML.SubElement(grails, 'nonInteractive').text = str( data.get('non-interactive', 'false')).lower() XML.SubElement(grails, 'useWrapper').text = str( data.get('use-wrapper', 'false')).lower() XML.SubElement(grails, 'plainOutput').text = str( data.get('plain-output', 'false')).lower() XML.SubElement(grails, 'stackTrace').text = str( data.get('stack-trace', 'false')).lower() XML.SubElement(grails, 'verbose').text = str( data.get('verbose', 'false')).lower() XML.SubElement(grails, 'refreshDependencies').text = str( data.get('refresh-dependencies', 'false')).lower() class Builders(jenkins_jobs.modules.base.Base): sequence = 60 component_type = 'builder' component_list_type = 'builders' def gen_xml(self, parser, xml_parent, data): for alias in ['prebuilders', 'builders', 'postbuilders']: if alias in data: builders = XML.SubElement(xml_parent, alias) for builder in data[alias]: self.registry.dispatch('builder', parser, builders, builder) # Make sure freestyle projects always have a entry # or Jenkins v1.472 (at least) will NPE. project_type = data.get('project-type', 'freestyle') if project_type in ('freestyle', 'matrix') and 'builders' not in data: XML.SubElement(xml_parent, 'builders') jenkins-job-builder-0.5.0/jenkins_jobs/modules/parameters.py0000664000175300017540000002125312160635010025346 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Parameters module allows you to specify build parameters for a job. **Component**: parameters :Macro: parameter :Entry Point: jenkins_jobs.parameters Example:: job: name: test_job parameters: - string: name: FOO default: bar description: "A parameter named FOO, defaults to 'bar'." """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base def base_param(parser, xml_parent, data, do_default, ptype): pdef = XML.SubElement(xml_parent, ptype) XML.SubElement(pdef, 'name').text = data['name'] XML.SubElement(pdef, 'description').text = data['description'] if do_default: default = data.get('default', None) if default: XML.SubElement(pdef, 'defaultValue').text = default else: XML.SubElement(pdef, 'defaultValue') return pdef def string_param(parser, xml_parent, data): """yaml: string A string parameter. :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) Example:: parameters: - string: name: FOO default: bar description: "A parameter named FOO, defaults to 'bar'." """ base_param(parser, xml_parent, data, True, 'hudson.model.StringParameterDefinition') def password_param(parser, xml_parent, data): """yaml: password A password parameter. :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) Example:: parameters: - password: name: FOO default: 1HSC0Ts6E161FysGf+e1xasgsHkgleLh09JUTYnipPvw= description: "A parameter named FOO." """ base_param(parser, xml_parent, data, True, 'hudson.model.PasswordParameterDefinition') def bool_param(parser, xml_parent, data): """yaml: bool A boolean parameter. :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) Example:: parameters: - bool: name: FOO default: false description: "A parameter named FOO, defaults to 'false'." """ data['default'] = str(data.get('default', 'false')).lower() base_param(parser, xml_parent, data, True, 'hudson.model.BooleanParameterDefinition') def file_param(parser, xml_parent, data): """yaml: file A file parameter. :arg str name: the target location for the file upload :arg str description: a description of the parameter (optional) Example:: parameters: - file: name: test.txt description: "Upload test.txt." """ base_param(parser, xml_parent, data, False, 'hudson.model.FileParameterDefinition') def text_param(parser, xml_parent, data): """yaml: text A text parameter. :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) Example:: parameters: - text: name: FOO default: bar description: "A parameter named FOO, defaults to 'bar'." """ base_param(parser, xml_parent, data, True, 'hudson.model.TextParameterDefinition') def label_param(parser, xml_parent, data): """yaml: label A node label parameter. :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) Example:: parameters: - label: name: node default: precise description: "The node on which to run the job" """ base_param(parser, xml_parent, data, True, 'org.jvnet.jenkins.plugins.nodelabelparameter.' 'LabelParameterDefinition') def choice_param(parser, xml_parent, data): """yaml: choice A single selection parameter. :arg str name: the name of the parameter :arg list choices: the available choices :arg str description: a description of the parameter (optional) Example:: parameters: - choice: name: project choices: - nova - glance description: "On which project to run?" """ pdef = base_param(parser, xml_parent, data, False, 'hudson.model.ChoiceParameterDefinition') choices = XML.SubElement(pdef, 'choices', {'class': 'java.util.Arrays$ArrayList'}) a = XML.SubElement(choices, 'a', {'class': 'string-array'}) for choice in data['choices']: XML.SubElement(a, 'string').text = choice def validating_string_param(parser, xml_parent, data): """yaml: validating-string A validating string parameter Requires the Jenkins `Validating String Plugin. `_ :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) :arg str regex: a regular expression to validate the string :arg str msg: a message to display upon failed validation Example:: parameters: - validating-string: name: FOO default: bar description: "A parameter named FOO, defaults to 'bar'." regex: [A-Za-z]* msg: Your entered value failed validation """ pdef = base_param(parser, xml_parent, data, True, 'hudson.plugins.validating__string__parameter.' 'ValidatingStringParameterDefinition') XML.SubElement(pdef, 'regex').text = data['regex'] XML.SubElement(pdef, 'failedValidationMessage').text = data['msg'] def svn_tags_param(parser, xml_parent, data): """yaml: svn-tags A svn tag parameter Requires the Jenkins `Parameterized Trigger Plugin. `_ :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) :arg str url: the url to list tags from :arg str filter: the regular expression to filter tags Example:: parameters: - svn-tags: name: BRANCH_NAME default: release description: A parameter named BRANCH_NAME default is release url: http://svn.example.com/repo filter: [A-za-z0-9]* """ pdef = base_param(parser, xml_parent, data, True, 'hudson.scm.listtagsparameter.' 'ListSubversionTagsParameterDefinition') XML.SubElement(pdef, 'tagsDir').text = data['url'] XML.SubElement(pdef, 'tagsFilter').text = data.get('filter', None) XML.SubElement(pdef, 'reverseByDate').text = "true" XML.SubElement(pdef, 'reverseByName').text = "false" XML.SubElement(pdef, 'maxTags').text = "100" XML.SubElement(pdef, 'uuid').text = "1-1-1-1-1" class Parameters(jenkins_jobs.modules.base.Base): sequence = 21 component_type = 'parameter' component_list_type = 'parameters' def gen_xml(self, parser, xml_parent, data): properties = xml_parent.find('properties') if properties is None: properties = XML.SubElement(xml_parent, 'properties') parameters = data.get('parameters', []) if parameters: pdefp = XML.SubElement(properties, 'hudson.model.ParametersDefinitionProperty') pdefs = XML.SubElement(pdefp, 'parameterDefinitions') for param in parameters: self.registry.dispatch('parameter', parser, pdefs, param) jenkins-job-builder-0.5.0/jenkins_jobs/modules/notifications.py0000664000175300017540000000520012160635010026046 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Notifications module allows you to configure Jenkins to notify other applications about various build phases. It requires the Jenkins notification plugin. **Component**: notifications :Macro: notification :Entry Point: jenkins_jobs.notifications Example:: job: name: test_job notifications: - http: url: http://example.com/jenkins_endpoint """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base def http_endpoint(parser, xml_parent, data): """yaml: http Defines an HTTP notification endpoint. Requires the Jenkins `Notification Plugin. `_ :arg str url: URL of the endpoint Example:: notifications: - http: url: http://example.com/jenkins_endpoint """ endpoint_element = XML.SubElement(xml_parent, 'com.tikal.hudson.plugins.notification.' 'Endpoint') XML.SubElement(endpoint_element, 'protocol').text = 'HTTP' XML.SubElement(endpoint_element, 'url').text = data['url'] class Notifications(jenkins_jobs.modules.base.Base): sequence = 22 component_type = 'notification' component_list_type = 'notifications' def gen_xml(self, parser, xml_parent, data): properties = xml_parent.find('properties') if properties is None: properties = XML.SubElement(xml_parent, 'properties') notifications = data.get('notifications', []) if notifications: notify_element = XML.SubElement(properties, 'com.tikal.hudson.plugins.' 'notification.' 'HudsonNotificationProperty') endpoints_element = XML.SubElement(notify_element, 'endpoints') for endpoint in notifications: self.registry.dispatch('notification', parser, endpoints_element, endpoint) jenkins-job-builder-0.5.0/jenkins_jobs/modules/general.py0000664000175300017540000000737412160635010024630 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Logrotate section allows you to automatically remove old build history. It adds the ``logrotate`` attribute to the :ref:`Job` definition. Example:: - job: name: test_job logrotate: daysToKeep: 3 numToKeep: 20 artifactDaysToKeep: -1 artifactNumToKeep: -1 The Assigned Node section allows you to specify which Jenkins node (or named group) should run the specified job. It adds the ``node`` attribute to the :ref:`Job` definition. Example:: - job: name: test_job node: precise That speficies that the job should be run on a Jenkins node or node group named ``precise``. """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base class General(jenkins_jobs.modules.base.Base): sequence = 10 def gen_xml(self, parser, xml, data): jdk = data.get('jdk', None) if jdk: XML.SubElement(xml, 'jdk').text = jdk XML.SubElement(xml, 'actions') description = XML.SubElement(xml, 'description') description.text = data.get('description', '') XML.SubElement(xml, 'keepDependencies').text = 'false' if data.get('disabled'): XML.SubElement(xml, 'disabled').text = 'true' else: XML.SubElement(xml, 'disabled').text = 'false' if data.get('block-downstream'): XML.SubElement(xml, 'blockBuildWhenDownstreamBuilding').text = 'true' else: XML.SubElement(xml, 'blockBuildWhenDownstreamBuilding').text = 'false' if data.get('block-upstream'): XML.SubElement(xml, 'blockBuildWhenUpstreamBuilding').text = 'true' else: XML.SubElement(xml, 'blockBuildWhenUpstreamBuilding').text = 'false' if 'auth-token' in data: XML.SubElement(xml, 'authToken').text = data['auth-token'] if data.get('concurrent'): XML.SubElement(xml, 'concurrentBuild').text = 'true' else: XML.SubElement(xml, 'concurrentBuild').text = 'false' if 'workspace' in data: XML.SubElement(xml, 'customWorkspace').text = \ str(data['workspace']) if('quiet-period' in data): XML.SubElement(xml, 'quietPeriod').text = str(data['quiet-period']) node = data.get('node', None) if node: XML.SubElement(xml, 'assignedNode').text = node XML.SubElement(xml, 'canRoam').text = 'false' else: XML.SubElement(xml, 'canRoam').text = 'true' if 'logrotate' in data: lr_xml = XML.SubElement(xml, 'logRotator') logrotate = data['logrotate'] lr_days = XML.SubElement(lr_xml, 'daysToKeep') lr_days.text = str(logrotate['daysToKeep']) lr_num = XML.SubElement(lr_xml, 'numToKeep') lr_num.text = str(logrotate['numToKeep']) lr_adays = XML.SubElement(lr_xml, 'artifactDaysToKeep') lr_adays.text = str(logrotate['artifactDaysToKeep']) lr_anum = XML.SubElement(lr_xml, 'artifactNumToKeep') lr_anum.text = str(logrotate['artifactNumToKeep']) jenkins-job-builder-0.5.0/jenkins_jobs/modules/hipchat_notif.py0000664000175300017540000001062512160635010026023 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ Enable hipchat notification of build execution. Example:: - job: name: test_job hipchat: enabled: true room: Testjob Build Notifications start-notify: true In the jenkins UI specification, the hipchat plugin must be explicitly selected as a publisher. This is not required (or supported) here - use the ``enabled`` parameter to enable/disable the publisher action. If you set ``enabled: false``, no hipchat parameters are written to XML. """ # Enabling hipchat notifications on a job requires specifying the hipchat # config in job properties, and adding the hipchat notifier to the job's # publishers list. # The publisher configuration contains extra details not specified per job: # - the hipchat authorisation token. # - the jenkins server url. # - a default room name/id. # This complicates matters somewhat since the sensible place to store these # details is in the global config file. # The global config object is therefore passed down to the registry object, # and this object is passed to the HipChat() class initialiser. import xml.etree.ElementTree as XML import jenkins_jobs.modules.base import jenkins_jobs.errors import logging import ConfigParser import sys logger = logging.getLogger(__name__) class HipChat(jenkins_jobs.modules.base.Base): sequence = 80 def __init__(self, registry): self.authToken = None self.jenkinsUrl = None self.registry = registry def _load_global_data(self): """Load data from the global config object. This is done lazily to avoid looking up the '[hipchat]' section unless actually required. """ if(not self.authToken): try: self.authToken = self.registry.global_config.get( 'hipchat', 'authtoken') # Require that the authtoken is non-null if self.authToken == '': raise jenkins_jobs.errors.JenkinsJobsException( "Hipchat authtoken must not be a blank string") except (ConfigParser.NoSectionError, jenkins_jobs.errors.JenkinsJobsException), e: logger.fatal("The configuration file needs a hipchat section" + " containing authtoken:\n{0}".format(e)) sys.exit(1) self.jenkinsUrl = self.registry.global_config.get('jenkins', 'url') def gen_xml(self, parser, xml_parent, data): hipchat = data.get('hipchat') if not hipchat or not hipchat.get('enabled', True): return if('room' not in hipchat): raise jenkins_jobs.errors.YAMLFormatError( "Missing hipchat 'room' specifier") self._load_global_data() properties = xml_parent.find('properties') if properties is None: properties = XML.SubElement(xml_parent, 'properties') pdefhip = XML.SubElement(properties, 'jenkins.plugins.hipchat.' 'HipChatNotifier_-HipChatJobProperty') XML.SubElement(pdefhip, 'room').text = hipchat['room'] XML.SubElement(pdefhip, 'startNotification').text = str( hipchat.get('start-notify', 'false')).lower() publishers = xml_parent.find('publishers') if publishers is None: publishers = XML.SubElement(xml_parent, 'publishers') hippub = XML.SubElement(publishers, 'jenkins.plugins.hipchat.HipChatNotifier') XML.SubElement(hippub, 'jenkinsUrl').text = self.jenkinsUrl XML.SubElement(hippub, 'authToken').text = self.authToken # The room specified here is the default room. The default is # redundant in this case since a room must be specified. Leave empty. XML.SubElement(hippub, 'room').text = '' jenkins-job-builder-0.5.0/jenkins_jobs/modules/base.py0000664000175300017540000000567612160635010024130 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. # Base class for a jenkins_jobs module import xml.etree.ElementTree as XML def add_nonblank_xml_subelement(parent, tag, value): """ Adds an XML SubElement with the name tag to parent if value is a non-empty string """ if value is not None and value != '': XML.SubElement(parent, tag).text = value class Base(object): """ A base class for a Jenkins Job Builder Module. The module is initialized before any YAML is parsed. :arg ModuleRegistry registry: the global module registry. """ #: The sequence number for the module. Modules are invoked in the #: order of their sequence number in order to produce consistently #: ordered XML output. sequence = 10 #: The component type for components of this module. This will be #: used to look for macros (they are defined singularly, and should #: not be plural). #: Set both component_type and component_list_type to None if module #: doesn't have components. component_type = None #: The component list type will be used to look up possible #: implementations of the component type via entry points (entry #: points provide a list of components, so it should be plural). #: Set both component_type and component_list_type to None if module #: doesn't have components. component_list_type = None def __init__(self, registry): self.registry = registry def handle_data(self, parser): """This method is called before any XML is generated. By overriding this method, the module may manipulate the YAML data structure on the parser however it likes before any XML is generated. If it has changed the data structure at all, it must return ``True``, otherwise, it must return ``False``. :arg YAMLParser parser: the global YAML Parser :rtype: boolean """ return False def gen_xml(self, parser, xml_parent, data): """Update the XML element tree based on YAML data. Override this method to add elements to the XML output. Create new Element objects and add them to the xml_parent. The YAML data structure must not be modified. :arg YAMLParser parser: the global YAML Parser :arg Element xml_parent: the parent XML element :arg dict data: the YAML data structure """ pass jenkins-job-builder-0.5.0/jenkins_jobs/modules/properties.py0000664000175300017540000003102712160635010025377 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Properties module supplies a wide range of options that are implemented as Jenkins job properties. **Component**: properties :Macro: property :Entry Point: jenkins_jobs.properties Example:: job: name: test_job properties: - github: url: https://github.com/openstack-ci/jenkins-job-builder/ """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base def promoted_build(parser, xml_parent, data): """yaml: promoted-build Marks a build for promotion. A promotion process with an identical name must be created via the web interface in the job in order for the job promotion to persist. Promotion processes themselves cannot be configured by jenkins-jobs due to the separate storage of plugin configuration files. Requires the Jenkins `Promoted Builds Plugin. `_ :arg list names: the promoted build names Example:: properties: - promoted-build: names: - "Release to QA" - "Jane Must Approve" """ promoted = XML.SubElement(xml_parent, 'hudson.plugins.promoted__builds.' 'JobPropertyImpl') names = data.get('names', []) if names: active_processes = XML.SubElement(promoted, 'activeProcessNames') for n in names: XML.SubElement(active_processes, 'string').text = str(n) def github(parser, xml_parent, data): """yaml: github Sets the GitHub URL for the project. :arg str url: the GitHub URL Example:: properties: - github: url: https://github.com/openstack-ci/jenkins-job-builder/ """ github = XML.SubElement(xml_parent, 'com.coravy.hudson.plugins.github.' 'GithubProjectProperty') github_url = XML.SubElement(github, 'projectUrl') github_url.text = data['url'] def throttle(parser, xml_parent, data): """yaml: throttle Throttles the number of builds for this job. Requires the Jenkins `Throttle Concurrent Builds Plugin. `_ :arg int max-per-node: max concurrent builds per node (default 0) :arg int max-total: max concurrent builds (default 0) :arg bool enabled: whether throttling is enabled (default True) :arg str option: throttle `project` or `category` :arg list categories: multiproject throttle categories Example:: properties: - throttle: max-total: 4 categories: - cat1 - cat2 """ throttle = XML.SubElement(xml_parent, 'hudson.plugins.throttleconcurrents.' 'ThrottleJobProperty') XML.SubElement(throttle, 'maxConcurrentPerNode').text = str( data.get('max-per-node', '0')) XML.SubElement(throttle, 'maxConcurrentTotal').text = str( data.get('max-total', '0')) # TODO: What's "categories"? #XML.SubElement(throttle, 'categories') if data.get('enabled', True): XML.SubElement(throttle, 'throttleEnabled').text = 'true' else: XML.SubElement(throttle, 'throttleEnabled').text = 'false' cat = data.get('categories', []) if cat: cn = XML.SubElement(throttle, 'categories') for c in cat: XML.SubElement(cn, 'string').text = str(c) XML.SubElement(throttle, 'throttleOption').text = data.get('option') XML.SubElement(throttle, 'configVersion').text = '1' def inject(parser, xml_parent, data): """yaml: inject Allows you to inject evironment variables into the build. Requires the Jenkins `Env Inject Plugin. `_ :arg str properties-file: file to read with properties (optional) :arg str properties-content: key=value properties (optional) :arg str script-file: file with script to run (optional) :arg str script-content: script to run (optional) :arg str groovy-content: groovy script to run (optional) :arg bool load-from-master: load files from master (default false) :arg bool enabled: injection enabled (default true) :arg bool keep-system-variables: keep system variables (default true) :arg bool keep-build-variables: keep build variable (default true) Example:: properties: - inject: properties-content: FOO=bar """ inject = XML.SubElement(xml_parent, 'EnvInjectJobProperty') info = XML.SubElement(inject, 'info') jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'propertiesFilePath', data.get('properties-file')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'propertiesContent', data.get('properties-content')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'scriptFilePath', data.get('script-file')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'scriptContent', data.get('script-content')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'groovyScriptContent', data.get('groovy-content')) XML.SubElement(info, 'loadFilesFromMaster').text = str( data.get('load-from-master', 'false')).lower() XML.SubElement(inject, 'on').text = str( data.get('enabled', 'true')).lower() XML.SubElement(inject, 'keepJenkinsSystemVariables').text = str( data.get('keep-system-variables', 'true')).lower() XML.SubElement(inject, 'keepBuildVariables').text = str( data.get('keep-build-variables', 'true')).lower() def authenticated_build(parser, xml_parent, data): """yaml: authenticated-build Specifies an authorization matrix where only authenticated users may trigger a build. DEPRECATED Example:: properties: - authenticated-build """ # TODO: generalize this if data: security = XML.SubElement(xml_parent, 'hudson.security.' 'AuthorizationMatrixProperty') XML.SubElement(security, 'permission').text = \ 'hudson.model.Item.Build:authenticated' def authorization(parser, xml_parent, data): """yaml: authorization Specifies an authorization matrix The available rights are: job-delete job-configure job-read job-discover job-build job-workspace job-cancel run-delete run-update scm-tag Example:: properties: - authorization: admin: - job-delete - job-configure - job-read - job-discover - job-build - job-workspace - job-cancel - run-delete - run-update - scm-tag anonymous: - job-discover - job-read """ mapping = { 'job-delete': 'hudson.model.Item.Delete', 'job-configure': 'hudson.model.Item.Configure', 'job-read': 'hudson.model.Item.Read', 'job-discover': 'hudson.model.Item.Discover', 'job-build': 'hudson.model.Item.Build', 'job-workspace': 'hudson.model.Item.Workspace', 'job-cancel': 'hudson.model.Item.Cancel', 'run-delete': 'hudson.model.Run.Delete', 'run-update': 'hudson.model.Run.Update', 'scm-tag': 'hudson.scm.SCM.Tag' } if data: matrix = XML.SubElement(xml_parent, 'hudson.security.AuthorizationMatrixProperty') for (username, perms) in data.items(): for perm in perms: pe = XML.SubElement(matrix, 'permission') pe.text = "{0}:{1}".format(mapping[perm], username) def extended_choice(parser, xml_parent, data): """yaml: extended-choice Creates an extended choice property where values can be read from a file Requires the Jenkins `Extended Choice Parameter Plugin. `_ :arg string name: name of the property :arg string description: description of the property (optional, default '') :arg string property-file: location of property file to read from (optional, default '') :arg string property-key: key for the property-file (optional, default '') :arg bool quote-value: whether to put quotes around the property when passing to Jenkins (optional, default false) :arg string visible-items: number of items to show in the list (optional, default 5) :arg string type: type of select (optional, default single-select) :arg string value: comma separated list of values for the single select or multi-select box (optional, default '') :arg string default-value: used to set the initial selection of the single-select or multi-select box (optional, default '') :arg string default-property-file: location of property file when default value needs to come from a property file (optional, default '') :arg string default-property-key: key for the default property file (optional, default '') Example:: properties: - extended-choice: name: FOO description: A foo property property-file: /home/foo/property.prop property-key: key quote-value: true visible-items: 10 type: multi-select value: foo,bar,select default-value: foo default-property-file: /home/property.prop default-property-key: fookey """ definition = XML.SubElement(xml_parent, 'hudson.model.ParametersDefinitionProperty') definitions = XML.SubElement(definition, 'parameterDefinitions') extended = XML.SubElement(definitions, 'com.cwctravel.hudson.plugins.' 'extended__choice__parameter.' 'ExtendedChoiceParameterDefinition') XML.SubElement(extended, 'name').text = data['name'] XML.SubElement(extended, 'description').text = data.get('description', '') XML.SubElement(extended, 'quoteValue').text = str(data.get('quote-value', 'false')).lower() XML.SubElement(extended, 'visibleItemCount').text = data.get( 'visible-items', '5') choice = data.get('type', 'single-select') choicedict = {'single-select': 'PT_SINGLE_SELECT', 'multi-select': 'PT_MULTI_SELECT', 'radio': 'PT_RADIO', 'checkbox': 'PT_CHECKBOX'} if choice not in choicedict: raise Exception("Type entered is not valid, must be one of: " + "single-select, multi-select, radio, or checkbox") XML.SubElement(extended, 'type').text = choicedict[choice] XML.SubElement(extended, 'value').text = data.get('value', '') XML.SubElement(extended, 'propertyFile').text = data.get('property-file', '') XML.SubElement(extended, 'propertyKey').text = data.get('property-key', '') XML.SubElement(extended, 'defaultValue').text = data.get('default-value', '') XML.SubElement(extended, 'defaultPropertyFile').text = data.get( 'default-property-file', '') XML.SubElement(extended, 'defaultPropertyKey').text = data.get( 'default-property-key', '') class Properties(jenkins_jobs.modules.base.Base): sequence = 20 component_type = 'property' component_list_type = 'properties' def gen_xml(self, parser, xml_parent, data): properties = xml_parent.find('properties') if properties is None: properties = XML.SubElement(xml_parent, 'properties') for prop in data.get('properties', []): self.registry.dispatch('property', parser, properties, prop) jenkins-job-builder-0.5.0/jenkins_jobs/modules/project_freestyle.py0000664000175300017540000000233512160635010026733 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Freestyle Project module handles creating freestyle Jenkins projects (i.e., those that do not use Maven). You may specify ``freestyle`` in the ``project-type`` attribute to the :ref:`Job` definition if you wish, though it is the default, so you may omit ``project-type`` altogether if you are creating a freestyle project. Example:: job: name: test_job project-type: freestyle """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base class Freestyle(jenkins_jobs.modules.base.Base): sequence = 0 def root_xml(self, data): xml_parent = XML.Element('project') return xml_parent jenkins-job-builder-0.5.0/jenkins_jobs/modules/zuul.py0000664000175300017540000001375012160635010024205 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Zuul module adds triggers that configure jobs for use with Zuul_. To change the Zuul notification URL, set a global default:: - defaults: name: global zuul-url: http://127.0.0.1:8001/jenkins_endpoint The above URL is the default. .. _Zuul: http://ci.openstack.org/zuul/ """ def zuul(): """yaml: zuul Configure this job to be triggered by Zuul. Example:: triggers: - zuul """ def zuul_post(): """yaml: zuul-post Configure this post-merge job to be triggered by Zuul. Example:: triggers: - zuul-post """ import jenkins_jobs.modules.base ZUUL_PARAMETERS = [ {'string': {'description': 'Zuul provided key to link builds with Gerrit events', 'name': 'ZUUL_UUID'}}, {'string': {'description': 'Zuul provided key to link builds with Gerrit' ' events (deprecated use ZUUL_UUID instead)', 'name': 'UUID'}}, {'string': {'description': 'Zuul pipeline triggering this job', 'name': 'ZUUL_PIPELINE'}}, {'string': {'description': 'Zuul provided project name', 'name': 'GERRIT_PROJECT'}}, {'string': {'description': 'Branch name of triggering project', 'name': 'ZUUL_PROJECT'}}, {'string': {'description': 'Zuul provided branch name', 'name': 'GERRIT_BRANCH'}}, {'string': {'description': 'Branch name of triggering change', 'name': 'ZUUL_BRANCH'}}, {'string': {'description': 'Zuul provided list of dependent changes to merge', 'name': 'GERRIT_CHANGES'}}, {'string': {'description': 'List of dependent changes to merge', 'name': 'ZUUL_CHANGES'}}, {'string': {'description': 'Reference for the merged commit(s) to use', 'name': 'ZUUL_REF'}}, {'string': {'description': 'The commit SHA1 at the head of ZUUL_REF', 'name': 'ZUUL_COMMIT'}}, {'string': {'description': 'List of included changes', 'name': 'ZUUL_CHANGE_IDS'}}, {'string': {'description': 'ID of triggering change', 'name': 'ZUUL_CHANGE'}}, {'string': {'description': 'Patchset of triggering change', 'name': 'ZUUL_PATCHSET'}}, ] ZUUL_POST_PARAMETERS = [ {'string': {'description': 'Zuul provided key to link builds with Gerrit events', 'name': 'ZUUL_UUID'}}, {'string': {'description': 'Zuul provided key to link builds with Gerrit' ' events (deprecated use ZUUL_UUID instead)', 'name': 'UUID'}}, {'string': {'description': 'Zuul pipeline triggering this job', 'name': 'ZUUL_PIPELINE'}}, {'string': {'description': 'Zuul provided project name', 'name': 'GERRIT_PROJECT'}}, {'string': {'description': 'Branch name of triggering project', 'name': 'ZUUL_PROJECT'}}, {'string': {'description': 'Zuul provided ref name', 'name': 'GERRIT_REFNAME'}}, {'string': {'description': 'Name of updated reference triggering this job', 'name': 'ZUUL_REF'}}, {'string': {'description': 'Name of updated reference triggering this job', 'name': 'ZUUL_REFNAME'}}, {'string': {'description': 'Zuul provided old reference for ref-updated', 'name': 'GERRIT_OLDREV'}}, {'string': {'description': 'Old SHA at this reference', 'name': 'ZUUL_OLDREV'}}, {'string': {'description': 'Zuul provided new reference for ref-updated', 'name': 'GERRIT_NEWREV'}}, {'string': {'description': 'New SHA at this reference', 'name': 'ZUUL_NEWREV'}}, {'string': {'description': 'Shortened new SHA at this reference', 'name': 'ZUUL_SHORT_NEWREV'}}, ] DEFAULT_URL = 'http://127.0.0.1:8001/jenkins_endpoint' class Zuul(jenkins_jobs.modules.base.Base): sequence = 0 def handle_data(self, parser): changed = False jobs = (parser.data.get('job', {}).values() + parser.data.get('job-template', {}).values()) for job in jobs: triggers = job.get('triggers') if not triggers: continue if ('zuul' not in job.get('triggers', []) and 'zuul-post' not in job.get('triggers', [])): continue if 'parameters' not in job: job['parameters'] = [] if 'notifications' not in job: job['notifications'] = [] # This isn't a good pattern, and somewhat violates the # spirit of the global defaults, but Zuul is working on # a better design that should obviate the need for most # of this module, so this gets it doen with minimal # intrusion to the rest of JJB. if parser.data.get('defaults', {}).get('global'): url = parser.data['defaults']['global'].get( 'zuul-url', DEFAULT_URL) notifications = [{'http': {'url': url}}] job['notifications'].extend(notifications) if 'zuul' in job.get('triggers', []): job['parameters'].extend(ZUUL_PARAMETERS) job['triggers'].remove('zuul') if 'zuul-post' in job.get('triggers', []): job['parameters'].extend(ZUUL_POST_PARAMETERS) job['triggers'].remove('zuul-post') changed = True return changed jenkins-job-builder-0.5.0/jenkins_jobs/modules/project_multijob.py0000664000175300017540000000365212160635010026561 0ustar jenkinsjenkins00000000000000# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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. """ The MultiJob Project module handles creating MultiJob Jenkins projects. You may specify ``multijob`` in the ``project-type`` attribute of the :ref:`Job` definition. This project type may use :py:func:`jenkins_jobs.modules.builders.multijob` \ builders. Requires the Jenkins `Multijob Plugin. `_ Example:: job: name: test_job project-type: multijob builders: - multijob: name: PhaseOne condition: SUCCESSFUL projects: - name: PhaseOneJobA current-parameters: true git-revision: true - name: PhaseOneJobB current-parameters: true property-file: build.props - multijob: name: PhaseTwo condition: UNSTABLE projects: - name: PhaseTwoJobA current-parameters: true predefined-parameters: foo=bar - name: PhaseTwoJobB current-parameters: false """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base class MultiJob(jenkins_jobs.modules.base.Base): sequence = 0 def root_xml(self, data): xml_parent = XML.Element('com.tikal.jenkins.plugins.multijob.' 'MultiJobProject') return xml_parent jenkins-job-builder-0.5.0/jenkins_jobs/modules/__init__.py0000664000175300017540000000000012160635010024725 0ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/modules/triggers.py0000664000175300017540000003171112160635010025031 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ Triggers define what causes a jenkins job to start buliding. **Component**: triggers :Macro: trigger :Entry Point: jenkins_jobs.triggers Example:: job: name: test_job triggers: - timed: '@daily' """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base import re def gerrit_handle_legacy_configuration(data): hyphenizer = re.compile("[A-Z]") def hyphenize(attr): """Convert strings like triggerOn to trigger-on. """ return hyphenizer.sub(lambda x: "-%s" % x.group(0).lower(), attr) def convert_dict(d, old_keys): for old_key in old_keys: if old_key in d: d[hyphenize(old_key)] = d[old_key] del d[old_key] convert_dict(data, [ 'triggerOnPatchsetUploadedEvent', 'triggerOnChangeAbandonedEvent', 'triggerOnChangeMergedEvent', 'triggerOnChangeRestoredEvent', 'triggerOnCommentAddedEvent', 'triggerOnDraftPublishedEvent', 'triggerOnRefUpdatedEvent', 'triggerApprovalCategory', 'triggerApprovalValue', 'overrideVotes', 'gerritBuildSuccessfulVerifiedValue', 'gerritBuildFailedVerifiedValue', 'failureMessage', 'skipVote', ]) for project in data['projects']: convert_dict(project, [ 'projectCompareType', 'projectPattern', 'branchCompareType', 'branchPattern', ]) def build_gerrit_triggers(xml_parent, data): available_simple_triggers = { 'trigger-on-change-abandoned-event': 'PluginChangeAbandonedEvent', 'trigger-on-change-merged-event': 'PluginChangeMergedEvent', 'trigger-on-change-restored-event': 'PluginChangeRestoredEvent', 'trigger-on-draft-published-event': 'PluginDraftPublishedEvent', 'trigger-on-patchset-uploaded-event': 'PluginPatchsetCreatedEvent', 'trigger-on-ref-updated-event': 'PluginRefUpdatedEvent', } tag_namespace = 'com.sonyericsson.hudson.plugins.gerrit.trigger.' \ 'hudsontrigger.events' trigger_on_events = XML.SubElement(xml_parent, 'triggerOnEvents') for config_key, tag_name in available_simple_triggers.iteritems(): if data.get(config_key, False): XML.SubElement(trigger_on_events, '%s.%s' % (tag_namespace, tag_name)) if data.get('trigger-on-comment-added-event', False): cadded = XML.SubElement(trigger_on_events, '%s.%s' % (tag_namespace, 'PluginCommentAddedEvent')) XML.SubElement(cadded, 'verdictCategory').text = \ data['trigger-approval-category'] XML.SubElement(cadded, 'commentAddedTriggerApprovalValue').text = \ str(data['trigger-approval-value']) def build_gerrit_skip_votes(xml_parent, data): outcomes = {'successful': 'onSuccessful', 'failed': 'onFailed', 'unstable': 'onUnstable', 'notbuilt': 'onNotBuilt'} skip_vote_node = XML.SubElement(xml_parent, 'skipVote') skip_vote = data.get('skip-vote', {}) for result_kind, tag_name in outcomes.iteritems(): if skip_vote.get(result_kind, False): XML.SubElement(skip_vote_node, tag_name).text = 'true' else: XML.SubElement(skip_vote_node, tag_name).text = 'false' def gerrit(parser, xml_parent, data): """yaml: gerrit Trigger on a Gerrit event. Requires the Jenkins `Gerrit Trigger Plugin `_ version >= 2.6.0. :arg bool trigger-on-patchset-uploaded-event: Trigger on patchset upload :arg bool trigger-on-change-abandoned-event: Trigger on change abandoned. Requires Gerrit Trigger Plugin version >= 2.8.0 :arg bool trigger-on-change-merged-event: Trigger on change merged :arg bool trigger-on-change-restored-event: Trigger on change restored. Requires Gerrit Trigger Plugin version >= 2.8.0 :arg bool trigger-on-comment-added-event: Trigger on comment added :arg bool trigger-on-draft-published-event: Trigger on draft published event :arg bool trigger-on-ref-updated-event: Trigger on ref-updated :arg str trigger-approval-category: Approval category for comment added :arg int trigger-approval-value: Approval value for comment added :arg bool override-votes: Override default vote values :arg int gerrit-build-successful-verified-value: Successful ''Verified'' value :arg int gerrit-build-failed-verified-value: Failed ''Verified'' value :arg str failure-message: Message to leave on failure :arg list projects: list of projects to match :Project: * **project-compare-type** (`str`) -- ''PLAIN'', ''ANT'' or ''REG_EXP'' * **project-pattern** (`str`) -- Project name pattern to match * **branch-compare-type** (`str`) -- ''PLAIN'', ''ANT'' or ''REG_EXP'' * **branch-pattern** (`str`) -- Branch name pattern to match * **file-paths** (`list`) -- List of file paths to match (optional) :File Path: * **compare-type** (`str`) -- ''PLAIN'', ''ANT'' or ''REG_EXP'' (optional, defaults to ''PLAIN'') * **pattern** (`str`) -- File path pattern to match :arg dict skip-vote: map of build outcomes for which Jenkins must skip vote. Requires Gerrit Trigger Plugin version >= 2.7.0 :Outcome: * **successful** (`bool`) * **failed** (`bool`) * **unstable** (`bool`) * **notbuilt** (`bool`) You may select one or more gerrit events upon which to trigger. You must also supply at least one project and branch, optionally more. If you select the comment-added trigger, you should alse indicate which approval category and value you want to trigger the job. Until version 0.4.0 of Jenkins Job Builder, camelCase keys were used to configure Gerrit Trigger Plugin, instead of hyphenated-keys. While still supported, camedCase keys are deprecated and should not be used. Example:: triggers: - gerrit: trigger-on-comment-added-event: true trigger-approval-category: 'APRV' trigger-approval-value: 1 projects: - project-compare-type: 'PLAIN' project-pattern: 'test-project' branch-compare-type: 'ANT' branch-pattern: '**' file-paths: - compare-type: ANT pattern: subdirectory/** skip-vote: successful: true failed: true unstable: true notbuilt: true """ gerrit_handle_legacy_configuration(data) projects = data['projects'] gtrig = XML.SubElement(xml_parent, 'com.sonyericsson.hudson.plugins.gerrit.trigger.' 'hudsontrigger.GerritTrigger') XML.SubElement(gtrig, 'spec') gprojects = XML.SubElement(gtrig, 'gerritProjects') for project in projects: gproj = XML.SubElement(gprojects, 'com.sonyericsson.hudson.plugins.gerrit.' 'trigger.hudsontrigger.data.GerritProject') XML.SubElement(gproj, 'compareType').text = \ project['project-compare-type'] XML.SubElement(gproj, 'pattern').text = project['project-pattern'] branches = XML.SubElement(gproj, 'branches') gbranch = XML.SubElement(branches, 'com.sonyericsson.hudson.plugins.' 'gerrit.trigger.hudsontrigger.data.Branch') XML.SubElement(gbranch, 'compareType').text = \ project['branch-compare-type'] XML.SubElement(gbranch, 'pattern').text = project['branch-pattern'] project_file_paths = project.get('file-paths', []) if project_file_paths: fps_tag = XML.SubElement(gproj, 'filePaths') for file_path in project_file_paths: fp_tag = XML.SubElement(fps_tag, 'com.sonyericsson.hudson.plugins.' 'gerrit.trigger.hudsontrigger.data.' 'FilePath') XML.SubElement(fp_tag, 'compareType').text = \ file_path.get('compare-type', 'PLAIN') XML.SubElement(fp_tag, 'pattern').text = file_path['pattern'] build_gerrit_skip_votes(gtrig, data) XML.SubElement(gtrig, 'silentMode').text = 'false' XML.SubElement(gtrig, 'escapeQuotes').text = 'true' build_gerrit_triggers(gtrig, data) if 'override-votes' in data and data['override-votes'] == 'true': XML.SubElement(gtrig, 'gerritBuildSuccessfulVerifiedValue').text = \ str(data['gerrit-build-successful-verified-value']) XML.SubElement(gtrig, 'gerritBuildFailedVerifiedValue').text = \ str(data['gerrit-build-failed-verified-value']) XML.SubElement(gtrig, 'buildStartMessage') XML.SubElement(gtrig, 'buildFailureMessage').text = data['failure-message'] XML.SubElement(gtrig, 'buildSuccessfulMessage') XML.SubElement(gtrig, 'buildUnstableMessage') XML.SubElement(gtrig, 'customUrl') def pollscm(parser, xml_parent, data): """yaml: pollscm Poll the SCM to determine if there has been a change. :Parameter: the polling interval (cron syntax) Example:: triggers: - pollscm: "\*/15 * * * \*" """ scmtrig = XML.SubElement(xml_parent, 'hudson.triggers.SCMTrigger') XML.SubElement(scmtrig, 'spec').text = data def timed(parser, xml_parent, data): """yaml: timed Trigger builds at certain times. :Parameter: when to run the job (cron syntax) Example:: triggers: - timed: "@midnight" """ scmtrig = XML.SubElement(xml_parent, 'hudson.triggers.TimerTrigger') XML.SubElement(scmtrig, 'spec').text = data def github(parser, xml_parent, data): """yaml: github Trigger a job when github repository is pushed to Requires the Jenkins `GitHub Plugin. `_ Example:: triggers: - github """ ghtrig = XML.SubElement(xml_parent, 'com.cloudbees.jenkins.' 'GitHubPushTrigger') XML.SubElement(ghtrig, 'spec').text = '' def github_pull_request(parser, xml_parent, data): """yaml: github-pull-request Build pull requests in github and report results Requires the Jenkins `GitHub Pull Request Builder Plugin. `_ :arg list admin-list: the users with admin rights (optional) :arg string cron: cron syntax of when to run (optional) :arg list white-list: users whose pull requests build (optional) :arg list org-list: orgs whose users should be white listed (optional) Example:: triggers: - github-pull-request: admin-list: - user1 - user2 cron: * * * * * white-list: - user3 - user4 org-list: - org1 - org2 """ ghprb = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.ghprb.' 'GhprbTrigger') XML.SubElement(ghprb, 'spec').text = data.get('cron', '') admin_string = "\n".join(data.get('admin-list', [])) XML.SubElement(ghprb, 'adminlist').text = admin_string white_string = "\n".join(data.get('white-list', [])) XML.SubElement(ghprb, 'whitelist').text = white_string org_string = "\n".join(data.get('org-list', [])) XML.SubElement(ghprb, 'orgslist').text = org_string XML.SubElement(ghprb, 'cron').text = data.get('cron', '') class Triggers(jenkins_jobs.modules.base.Base): sequence = 50 component_type = 'trigger' component_list_type = 'triggers' def gen_xml(self, parser, xml_parent, data): triggers = data.get('triggers', []) if not triggers: return trig_e = XML.SubElement(xml_parent, 'triggers', {'class': 'vector'}) for trigger in triggers: self.registry.dispatch('trigger', parser, trig_e, trigger) jenkins-job-builder-0.5.0/jenkins_jobs/modules/scm.py0000664000175300017540000003774212160635010023777 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The SCM module allows you to specify the source code location for the 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 Example:: job: name: test_job scm: -git: url: https://example.com/project.git -git: url: https://example.org/otherproject.git basedir: other """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base def git(self, xml_parent, data): """yaml: git Specifies the git SCM repository for this job. Requires the Jenkins `Git Plugin. `_ :arg str url: URL of the git repository :arg str refspec: refspec to fetch :arg str name: name to fetch :arg list(str) branches: list of branch specifiers to build :arg list(str) excluded-users: list of users to ignore revisions from when polling for changes. (if polling is enabled) :arg list(str) included-regions: list of file/folders to include :arg list(str) excluded-regions: list of file/folders to exclude :arg dict merge: :merge: * **remote** (`string`) - name of repo that contains branch to merge to (default 'origin') * **branch** (`string`) - name of the branch to merge to :arg str basedir: location relative to the workspace root to clone to (default: workspace) :arg bool skip-tag: Skip tagging :arg bool prune: Prune remote branches :arg bool clean: Clean after checkout :arg bool fastpoll: Use fast remote polling :arg bool disable-submodules: Disable submodules :arg bool recursive-submodules: Recursively update submodules :arg bool use-author: Use author rather than committer in Jenkin's build changeset :arg str git-tool: The name of the Git installation to use :arg bool wipe-workspace: Wipe out workspace before build :arg str browser: what repository browser to use (default '(Auto)') :arg str browser-url: url for the repository browser :browser values: :githubweb: :fisheye: :bitbucketweb: :gitblit: :gitlab: :gitoriousweb: :gitweb: :redmineweb: :viewgit: Example:: scm: - git: url: https://example.com/project.git branches: - master - stable browser: githubweb browser-url: http://github.com/foo/example.git """ # XXX somebody should write the docs for those with option name = # None so we have a sensible name/key for it. mapping = [ # option, xml name, default value (text), attributes (hard coded) ("disable-submodules", 'disableSubmodules', False), ("recursive-submodules", 'recursiveSubmodules', False), (None, 'doGenerateSubmoduleConfigurations', False), ("use-author", 'authorOrCommitter', False), ("clean", 'clean', False), ("wipe-workspace", 'wipeOutWorkspace', True), ("prune", 'pruneBranches', False), ("fastpoll", 'remotePoll', False), (None, 'buildChooser', '', { 'class': 'hudson.plugins.git.util.DefaultBuildChooser'}), ("git-tool", 'gitTool', "Default"), (None, 'submoduleCfg', '', {'class': 'list'}), ('basedir', 'relativeTargetDir', ''), (None, 'reference', ''), (None, 'gitConfigName', ''), (None, 'gitConfigEmail', ''), ('skip-tag', 'skipTag', False), (None, 'scmName', ''), ] scm = XML.SubElement(xml_parent, 'scm', {'class': 'hudson.plugins.git.GitSCM'}) XML.SubElement(scm, 'configVersion').text = '2' user = XML.SubElement(scm, 'userRemoteConfigs') huser = XML.SubElement(user, 'hudson.plugins.git.UserRemoteConfig') XML.SubElement(huser, 'name').text = data.get('name', 'origin') if 'refspec' in data: refspec = data['refspec'] else: refspec = '+refs/heads/*:refs/remotes/origin/*' XML.SubElement(huser, 'refspec').text = refspec XML.SubElement(huser, 'url').text = data['url'] xml_branches = XML.SubElement(scm, 'branches') branches = data.get('branches', ['**']) for branch in branches: bspec = XML.SubElement(xml_branches, 'hudson.plugins.git.BranchSpec') XML.SubElement(bspec, 'name').text = branch excluded_users = '\n'.join(data.get('excluded-users', [])) XML.SubElement(scm, 'excludedUsers').text = excluded_users if 'included-regions' in data: include_string = '\n'.join(data['included-regions']) XML.SubElement(scm, 'includedRegions').text = include_string if 'excluded-regions' in data: exclude_string = '\n'.join(data['excluded-regions']) XML.SubElement(scm, 'excludedRegions').text = exclude_string if 'merge' in data: merge = data['merge'] name = merge.get('remote', 'origin') branch = merge['branch'] urc = XML.SubElement(scm, 'userMergeOptions') XML.SubElement(urc, 'mergeRemote').text = name XML.SubElement(urc, 'mergeTarget').text = branch for elem in mapping: (optname, xmlname, val) = elem[:3] attrs = {} if len(elem) >= 4: attrs = elem[3] xe = XML.SubElement(scm, xmlname, attrs) if optname and optname in data: val = data[optname] if type(val) == bool: xe.text = str(val).lower() else: xe.text = val browser = data.get('browser', 'auto') browserdict = {'githubweb': 'GithubWeb', 'fisheye': 'FisheyeGitRepositoryBrowser', 'bitbucketweb': 'BitbucketWeb', 'cgit': 'CGit', 'gitblit': 'GitBlitRepositoryBrowser', 'gitlab': 'GitLab', 'gitoriousweb': 'GitoriousWeb', 'gitweb': 'GitWeb', 'redmineweb': 'RedmineWeb', 'viewgit': 'ViewGitWeb', 'auto': 'auto'} if browser not in browserdict: raise Exception("Browser entered is not valid must be one of: " + "githubweb, fisheye, bitbucketweb, cgit, gitblit, " + "gitlab, gitoriousweb, gitweb, redmineweb, viewgit, " + "or auto") if browser != 'auto': bc = XML.SubElement(scm, 'browser', {'class': 'hudson.plugins.git.browser.' + browserdict[browser]}) XML.SubElement(bc, 'url').text = data['browser-url'] def svn(self, xml_parent, data): """yaml: svn Specifies the svn SCM repository for this job. :arg str url: URL of the svn repository :arg str basedir: location relative to the workspace root to checkout to (default '.') :arg str workspaceupdater: optional argument to specify how to update the workspace (default wipeworkspace) :arg list repos: list of repositories to checkout (optional) :Repo: * **url** (`str`) -- URL for the repository * **basedir** (`str`) -- Location relative to the workspace root to checkout to (default '.') :workspaceupdater values: :wipeworkspace: - deletes the workspace before checking out :revertupdate: - do an svn revert then an svn update :emulateclean: - delete unversioned/ignored files then update :update: - do an svn update as much as possible Example:: scm: - svn: workspaceupdater: update repos: - url: http://svn.example.com/repo basedir: . - url: http://svn.example.com/repo2 basedir: repo2 """ scm = XML.SubElement(xml_parent, 'scm', {'class': 'hudson.scm.SubversionSCM'}) locations = XML.SubElement(scm, 'locations') if 'repos' in data: repos = data['repos'] for repo in repos: module = XML.SubElement(locations, 'hudson.scm.SubversionSCM_-ModuleLocation') XML.SubElement(module, 'remote').text = repo['url'] XML.SubElement(module, 'local').text = repo.get('basedir', '.') elif 'url' in data: module = XML.SubElement(locations, 'hudson.scm.SubversionSCM_-ModuleLocation') XML.SubElement(module, 'remote').text = data['url'] XML.SubElement(module, 'local').text = data.get('basedir', '.') else: raise Exception("A top level url or repos list must exist") updater = data.get('workspaceupdater', 'wipeworkspace') if updater == 'wipeworkspace': updaterclass = 'CheckoutUpdater' elif updater == 'revertupdate': updaterclass = 'UpdateWithRevertUpdater' elif updater == 'emulateclean': updaterclass = 'UpdateWithCleanUpdater' elif updater == 'update': updaterclass = 'UpdateUpdater' XML.SubElement(scm, 'workspaceUpdater', {'class': 'hudson.scm.subversion.' + updaterclass}) def tfs(self, xml_parent, data): """yaml: tfs Specifies the Team Foundation Server repository for this job. Requires the Jenkins `Team Foundation Server Plugin. `_ **NOTE**: TFS Password must be entered manually on the project if a user name is specified. The password will be overwritten with an empty value every time the job is rebuilt with Jenkins Job Builder. :arg str server-url: The name or URL of the team foundation server. If the server has been registered on the machine then it is only necessary to enter the name. :arg str project-path: The name of the project as it is registered on the server. :arg str login: The user name that is registered on the server. The user name must contain the name and the domain name. Entered as domain\\\user or user\@domain (optional). **NOTE**: You must enter in at least two slashes for the domain\\\user format in JJB YAML. It will be rendered normally. :arg str use-update: If true, Hudson will not delete the workspace at end of each build. This causes the artifacts from the previous build to remain when a new build starts. (default true) :arg str local-path: The folder where all files will be retrieved into. The folder name is a relative path, under the workspace of the current job. (default .) :arg str workspace: The name of the workspace under which the source should be retrieved. This workspace is created at the start of a download, and deleted at the end. You can normally omit the property unless you want to name a workspace to avoid conflicts on the server (i.e. when you have multiple projects on one server talking to a Team Foundation Server). (default Hudson-${JOB_NAME}-${NODE_NAME}) The TFS plugin supports the following macros that are replaced in the workspace name: * ${JOB_NAME} - The name of the job. * ${USER_NAME} - The user name that the Hudson server or slave is running as. * ${NODE_NAME} - The name of the node/slave that the plugin currently is executed on. Note that this is not the hostname, this value is the Hudson configured name of the slave/node. * ${ENV} - The environment variable that is set on the master or slave. :arg dict web-access: Adds links in "changes" views within Jenkins to an external system for browsing the details of those changes. The "Auto" selection attempts to infer the repository browser from other jobs, if supported by the SCM and a job with matching SCM details can be found. (optional, default Auto). :web-access value: * **web-url** -- Enter the URL to the TSWA server. The plugin will strip the last path (if any) of the URL when building URLs for change set pages and other pages. (optional, default uses server-url) Examples:: scm: - tfs: server-url: "tfs.company.com" project-path: "$/myproject" login: "mydomain\\\jane" use-update: false local-path: "../foo/" workspace: "Hudson-${JOB_NAME}" web-access: - web-url: "http://TFSMachine:8080" scm: - tfs: server-url: "tfs.company.com" project-path: "$/myproject" login: "jane@mydomain" use-update: false local-path: "../foo/" workspace: "Hudson-${JOB_NAME}" web-access: scm: - tfs: server-url: "tfs.company.com" project-path: "$/myproject" login: "mydomain\\\jane" use-update: false local-path: "../foo/" workspace: "Hudson-${JOB_NAME}" """ tfs = XML.SubElement(xml_parent, 'scm', {'class': 'hudson.plugins.tfs.' 'TeamFoundationServerScm'}) XML.SubElement(tfs, 'serverUrl').text = str( data.get('server-url', '')) XML.SubElement(tfs, 'projectPath').text = str( data.get('project-path', '')) XML.SubElement(tfs, 'localPath').text = str( data.get('local-path', '.')) XML.SubElement(tfs, 'workspaceName').text = str( data.get('workspace', 'Hudson-${JOB_NAME}-${NODE_NAME}')) # TODO: In the future, with would be nice to have a place that can pull # passwords into JJB without having to commit them in plaintext. This # could also integrate nicely with global configuration options. XML.SubElement(tfs, 'userPassword') XML.SubElement(tfs, 'userName').text = str( data.get('login', '')) XML.SubElement(tfs, 'useUpdate').text = str( data.get('use-update', 'true')) store = data.get('web-access', None) if 'web-access' in data and isinstance(store, list): web = XML.SubElement(tfs, 'repositoryBrowser', {'class': 'hudson.' 'plugins.tfs.browsers.' 'TeamSystemWebAccessBrowser'}) XML.SubElement(web, 'url').text = str(store[0].get('web-url', None)) elif 'web-access' in data and store is None: XML.SubElement(tfs, 'repositoryBrowser', {'class': 'hudson.' 'plugins.tfs.browsers.' 'TeamSystemWebAccess' 'Browser'}) class SCM(jenkins_jobs.modules.base.Base): sequence = 30 component_type = 'scm' 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: XML.SubElement(xml_parent, 'scm', {'class': 'hudson.scm.NullSCM'}) jenkins-job-builder-0.5.0/jenkins_jobs/modules/wrappers.py0000664000175300017540000003601412160635010025047 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ Wrappers can alter the way the build is run as well as the build output. **Component**: wrappers :Macro: wrapper :Entry Point: jenkins_jobs.wrappers Example:: job: name: test_job wrappers: - timeout: timeout: 90 fail: true """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base def timeout(parser, xml_parent, data): """yaml: timeout Abort the build if it runs too long. Requires the Jenkins `Build Timeout Plugin. `_ :arg int timeout: Abort the build after this number of minutes :arg bool fail: Mark the build as failed (default false) Example:: wrappers: - timeout: timeout: 90 fail: true """ twrapper = XML.SubElement(xml_parent, 'hudson.plugins.build__timeout.' 'BuildTimeoutWrapper') tminutes = XML.SubElement(twrapper, 'timeoutMinutes') tminutes.text = str(data['timeout']) failbuild = XML.SubElement(twrapper, 'failBuild') fail = data.get('fail', False) if fail: failbuild.text = 'true' else: failbuild.text = 'false' def timestamps(parser, xml_parent, data): """yaml: timestamps Add timestamps to the console log. Requires the Jenkins `Timestamper Plugin. `_ Example:: wrappers: - timestamps """ XML.SubElement(xml_parent, 'hudson.plugins.timestamper.TimestamperBuildWrapper') def ansicolor(parser, xml_parent, data): """yaml: ansicolor Translate ANSI color codes to HTML in the console log. Requires the Jenkins `Ansi Color Plugin. `_ Example:: wrappers: - ansicolor """ XML.SubElement(xml_parent, 'hudson.plugins.ansicolor.AnsiColorBuildWrapper') def mask_passwords(parser, xml_parent, data): """yaml: mask-passwords Hide passwords in the console log. Requires the Jenkins `Mask Passwords Plugin. `_ Example:: wrappers: - mask-passwords """ XML.SubElement(xml_parent, 'com.michelin.cio.hudson.plugins.maskpasswords.' 'MaskPasswordsBuildWrapper') def workspace_cleanup(parser, xml_parent, data): """yaml: workspace-cleanup (pre-build) See `Workspace Cleanup Plugin. `_ The post-build workspace-cleanup is available as a publisher. :arg list include: list of files to be included :arg list exclude: list of files to be excluded :arg bool dirmatch: Apply pattern to directories too Example:: wrappers: - workspace-cleanup: include: - "*.zip" """ p = XML.SubElement(xml_parent, 'hudson.plugins.ws__cleanup.PreBuildCleanup') p.set("plugin", "ws-cleanup@0.14") if "include" in data or "exclude" in data: patterns = XML.SubElement(p, 'patterns') for inc in data.get("include", []): ptrn = XML.SubElement(patterns, 'hudson.plugins.ws__cleanup.Pattern') XML.SubElement(ptrn, 'pattern').text = inc XML.SubElement(ptrn, 'type').text = "INCLUDE" for exc in data.get("exclude", []): ptrn = XML.SubElement(patterns, 'hudson.plugins.ws__cleanup.Pattern') XML.SubElement(ptrn, 'pattern').text = exc XML.SubElement(ptrn, 'type').text = "EXCLUDE" deldirs = XML.SubElement(p, 'deleteDirs') deldirs.text = str(data.get("dirmatch", "false")).lower() def build_name(parser, xml_parent, data): """yaml: build-name Set the name of the build Requires the Jenkins `Build Name Setter Plugin. `_ :arg str name: Name for the build. Typically you would use a variable from Jenkins in the name. The syntax would be ${FOO} for the FOO variable. Example:: wrappers: - build-name: name: Build-${FOO} """ bsetter = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.buildnamesetter.' 'BuildNameSetter') XML.SubElement(bsetter, 'template').text = data['name'] def port_allocator(parser, xml_parent, data): """yaml: port-allocator Assign unique TCP port numbers Requires the Jenkins `Port Allocator Plugin. `_ :arg str name: Variable name of the port or a specific port number Example:: wrappers: - port-allocator: name: SERVER_PORT """ pa = XML.SubElement(xml_parent, 'org.jvnet.hudson.plugins.port__allocator.' 'PortAllocator') ports = XML.SubElement(pa, 'ports') dpt = XML.SubElement(ports, 'org.jvnet.hudson.plugins.port__allocator.' 'DefaultPortType') XML.SubElement(dpt, 'name').text = data['name'] def locks(parser, xml_parent, data): """yaml: locks Control parallel execution of jobs. Requires the Jenkins `Locks and Latches Plugin. `_ :arg: list of locks to use Example:: wrappers: - locks: - FOO - FOO2 """ lw = XML.SubElement(xml_parent, 'hudson.plugins.locksandlatches.LockWrapper') locktop = XML.SubElement(lw, 'locks') locks = data for lock in locks: lockwrapper = XML.SubElement(locktop, 'hudson.plugins.locksandlatches.' 'LockWrapper_-LockWaitConfig') XML.SubElement(lockwrapper, 'name').text = lock def copy_to_slave(parser, xml_parent, data): """yaml: copy-to-slave Copy files to slave before build Requires the Jenkins `Copy To Slave Plugin. `_ :arg list includes: list of file patterns to copy :arg list excludes: list of file patterns to exclude :arg bool flatten: flatten directory structure :arg str relative-to: base location of includes/excludes, must be userContent ($JENKINS_HOME/userContent) home ($JENKINS_HOME) or workspace :arg bool include-ant-excludes: exclude ant's default excludes Example:: wrappers: - copy-to-slave: includes: - file1 - file2*.txt excludes: - file2bad.txt """ p = 'com.michelin.cio.hudson.plugins.copytoslave.CopyToSlaveBuildWrapper' cs = XML.SubElement(xml_parent, p) XML.SubElement(cs, 'includes').text = ','.join(data.get('includes', [''])) XML.SubElement(cs, 'excludes').text = ','.join(data.get('excludes', [''])) XML.SubElement(cs, 'flatten').text = \ str(data.get('flatten', 'false')).lower() XML.SubElement(cs, 'includeAntExcludes').text = \ str(data.get('include-ant-excludes', 'false')).lower() rel = str(data.get('relative-to', 'userContent')) opt = ('userContent', 'home', 'workspace') if rel not in opt: raise ValueError('relative-to must be one of %r' % opt) XML.SubElement(cs, 'relativeTo').text = rel # seems to always be false, can't find it in source code XML.SubElement(cs, 'hudsonHomeRelative').text = 'false' def inject(parser, xml_parent, data): """yaml: inject Add or override environment variables to the whole build process Requires the Jenkins `EnvInject Plugin. `_ :arg str properties-file: path to the properties file (default '') :arg str properties-content: key value pair of properties (default '') :arg str script-file: path to the script file (default '') :arg str script-content: contents of a script (default '') Example:: wrappers: - inject: properties-file: /usr/local/foo properties-content: PATH=/foo/bar script-file: /usr/local/foo.sh script-content: echo $PATH """ eib = XML.SubElement(xml_parent, 'EnvInjectBuildWrapper') info = XML.SubElement(eib, 'info') jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'propertiesFilePath', data.get('properties-file')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'propertiesContent', data.get('properties-content')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'scriptFilePath', data.get('script-file')) jenkins_jobs.modules.base.add_nonblank_xml_subelement( info, 'scriptContent', data.get('script-content')) XML.SubElement(info, 'loadFilesFromMaster').text = 'false' def jclouds(parser, xml_parent, data): """yaml: jclouds :arg bool single-use: Whether or not to terminate the slave after use (default: False). :arg list instances: The name of the jclouds template to create an instance from, and its parameters. :arg str cloud-name: The name of the jclouds profile containing the specified template. :arg int count: How many instances to create (default: 1). :arg bool stop-on-terminate: Whether or not to suspend instead of terminate the instance (default: False). Example:: wrappers: - jclouds: single-use: True instances: - jenkins-dev-slave: cloud-name: mycloud1 count: 1 stop-on-terminate: True - jenkins-test-slave: cloud-name: mycloud2 count: 2 stop-on-terminate: False """ buildWrapper = XML.SubElement(xml_parent, 'jenkins.plugins.jclouds.compute.' 'JCloudsBuildWrapper') instances = XML.SubElement(buildWrapper, 'instancesToRun') if 'instances' in data: for foo in data['instances']: for template, params in foo.items(): instance = XML.SubElement(instances, 'jenkins.plugins.jclouds.compute.' 'InstancesToRun') XML.SubElement(instance, 'templateName').text = template XML.SubElement(instance, 'cloudName').text = \ params.get('cloud-name', '') XML.SubElement(instance, 'count').text = \ str(params.get('count', 1)) XML.SubElement(instance, 'suspendOrTerminate').text = \ str(params.get('stop-on-terminate', False)).lower() if data.get('single-use'): XML.SubElement(xml_parent, 'jenkins.plugins.jclouds.compute.' 'JCloudsOneOffSlave') def build_user_vars(parser, xml_parent, data): """yaml: build-user-vars Set environment variables to the value of the user that started the build. Requires the Jenkins `Build User Vars Plugin. `_ Example:: wrappers: - build-user-vars """ XML.SubElement(xml_parent, 'org.jenkinsci.plugins.builduser.BuildUser') def release(parser, xml_parent, data): """yaml: release Add release build configuration Requires the Jenkins `Release Plugin. `_ :arg bool keep-forever: Keep build forever (default is 'true') :arg bool override-build-parameters: Enable build-parameter override :arg string version-template: Release version template :arg list parameters: Release parameters (see the :ref:`Parameters` module) :arg list pre-build: Pre-build steps (see the :ref:`Builders` module) :arg list post-build: Post-build steps (see :ref:`Builders`) :arg list post-success: Post successful-build steps (see :ref:`Builders`) :arg list post-failed: Post failed-build steps (see :ref:`Builders`) Example:: wrappers: - release: keep-forever: false parameters: - string: name: RELEASE_BRANCH default: '' description: Git branch to release from. post-success: - shell: | #!/bin/bash copy_build_artefacts.sh """ relwrap = XML.SubElement(xml_parent, 'hudson.plugins.release.ReleaseWrapper') # For 'keep-forever', the sense of the XML flag is the opposite of # the YAML flag. no_keep_forever = 'false' if str(data.get('keep-forever', 'true')).lower() == 'false': no_keep_forever = 'true' XML.SubElement(relwrap, 'doNotKeepLog').text = no_keep_forever XML.SubElement(relwrap, 'overrideBuildParameters').text = str( data.get('override-build-parameters', 'false')).lower() XML.SubElement(relwrap, 'releaseVersionTemplate').text = data.get( 'version-template', '') for param in data.get('parameters', []): parser.registry.dispatch('parameter', parser, XML.SubElement(relwrap, 'parameterDefinitions'), param) builder_steps = { 'pre-build': 'preBuildSteps', 'post-build': 'postBuildSteps', 'post-success': 'postSuccessfulBuildSteps', 'post-fail': 'postFailedBuildSteps', } for step in builder_steps.keys(): for builder in data.get(step, []): parser.registry.dispatch('builder', parser, XML.SubElement(relwrap, builder_steps[step]), builder) class Wrappers(jenkins_jobs.modules.base.Base): sequence = 80 component_type = 'wrapper' component_list_type = 'wrappers' def gen_xml(self, parser, xml_parent, data): wrappers = XML.SubElement(xml_parent, 'buildWrappers') for wrap in data.get('wrappers', []): self.registry.dispatch('wrapper', parser, wrappers, wrap) jenkins-job-builder-0.5.0/jenkins_jobs/modules/project_maven.py0000664000175300017540000001014412160635010026034 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ The Maven Project module handles creating Maven Jenkins projects. To create a Maven project, specify ``maven`` in the ``project-type`` attribute to the :ref:`Job` definition. It also requires a ``maven`` section in the :ref:`Job` definition. :Job Parameters: * **root-module**: * **group-id** (`str`): GroupId. (required) * **artifact-id** (`str`): ArtifactId. (required) * **root-pom** (`str`): The path to the pom.xml file. (defaults to pom.xml) * **goals** (`str`): Goals to execute. (required) * **maven-opts** (`str`): Java options to pass to maven (aka MAVEN_OPTS) * **maven-name** (`str`): Installation of maven which should be used. Not setting ``maven-name`` appears to use the first maven install defined in the global jenkins config. * **ignore-upstream-changes** (`bool`): Do not start a build whenever a SNAPSHOT dependency is built or not. (defaults to true) * **automatic-archiving** (`bool`): Activate automatic artifact archiving (defaults to true). Example:: job: name: doc_job project-type: maven maven: root-module: group-id: org.example.docs artifact-id: example-guide root-pom: doc/src/pom.xml goals: "clean generate-sources" maven-opts: '-Dmyvar=/path/somewhere' maven-name: Maven3 automatic-archiving: true """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base class Maven(jenkins_jobs.modules.base.Base): sequence = 0 def root_xml(self, data): if 'maven' not in data: return None xml_parent = XML.Element('maven2-moduleset') root_module = XML.SubElement(xml_parent, 'rootModule') XML.SubElement(root_module, 'groupId').text = \ data['maven']['root-module']['group-id'] XML.SubElement(root_module, 'artifactId').text = \ data['maven']['root-module']['artifact-id'] XML.SubElement(xml_parent, 'goals').text = data['maven']['goals'] maven_opts = data['maven'].get('maven-opts') if maven_opts: XML.SubElement(xml_parent, 'mavenOpts').text = maven_opts maven_name = data['maven'].get('maven-name') if maven_name: XML.SubElement(xml_parent, 'mavenName').text = maven_name XML.SubElement(xml_parent, 'ignoreUpstremChanges').text = str( data['maven'].get('ignore-upstream-changes', 'true')).lower() XML.SubElement(xml_parent, 'rootPOM').text = \ data['maven'].get('root-pom', 'pom.xml') XML.SubElement(xml_parent, 'aggregatorStyleBuild').text = 'true' XML.SubElement(xml_parent, 'incrementalBuild').text = 'false' XML.SubElement(xml_parent, 'perModuleEmail').text = 'true' XML.SubElement(xml_parent, 'archivingDisabled').text = str( not data['maven'].get('automatic-archiving', True)).lower() XML.SubElement(xml_parent, 'resolveDependencies').text = 'false' XML.SubElement(xml_parent, 'processPlugins').text = 'false' XML.SubElement(xml_parent, 'mavenValidationLevel').text = '-1' XML.SubElement(xml_parent, 'runHeadless').text = 'false' XML.SubElement(xml_parent, 'settingConfigId') XML.SubElement(xml_parent, 'globalSettingConfigId') run_post_steps = XML.SubElement(xml_parent, 'runPostStepsIfResult') XML.SubElement(run_post_steps, 'name').text = 'FAILURE' XML.SubElement(run_post_steps, 'ordinal').text = '2' XML.SubElement(run_post_steps, 'color').text = 'red' return xml_parent jenkins-job-builder-0.5.0/jenkins_jobs/modules/project_matrix.py0000664000175300017540000001175012160635010026236 0ustar jenkinsjenkins00000000000000# Copyright 2012 Julian Taylor # # 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. """ The matrix project module handles creating Jenkins matrix projects. To create a matrix project specify ``matrix`` in the ``project-type`` attribute to the :ref:`Job` definition. Currently it only supports three axes which share the same internal YAML structure: * label expressions (``label-expression``) * user-defined values (``user-defined``) * slave name or label (``slave``) :Job Parameters: * **execution-strategy** (optional): * **combination-filter** (`str`): axes selection filter * **sequential** (`bool`): run builds sequentially (default false) * **touchstone** (optional): * **expr** (`str`) -- selection filter for the touchstone build * **result** (`str`) -- required result of the job: \ stable (default) or unstable * **axes** (`list`): * **axis**: * **type** (`str`) -- axis type, must be either 'label-expression', 'user-defined' or 'slave'. * **name** (`str`) -- name of the axis * **values** (`list`) -- values of the axis Example:: - job: name: matrix-test project-type: matrix execution-strategy: combination-filter: | !(os=="fedora11" && arch=="amd64") sequential: true touchstone: expr: 'os == "fedora11"' result: unstable axes: - axis: type: label-expression name: os values: - ubuntu12.04 - fedora11 - axis: type: label-expression name: arch values: - amd64 - i386 - axis: type: slave name: nodes values: - node1 - node2 builders: - shell: make && make check Example using user-defined axis:: - job: name: matrix-user-defined project-type: matrix axes: - axis: type: user-defined name: database values: - mysql - postgresql - sqlite builders: - shell: make "$database" """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base class Matrix(jenkins_jobs.modules.base.Base): sequence = 0 # List the supported Axis names in our configuration # and map them to the Jenkins XML element name. supported_axis = { 'label-expression': 'hudson.matrix.LabelExpAxis', 'user-defined': 'hudson.matrix.TextAxis', 'slave': 'hudson.matrix.LabelAxis', } def root_xml(self, data): root = XML.Element('matrix-project') ex_r = XML.SubElement(root, 'executionStrategy', {'class': 'hudson.matrix.' 'DefaultMatrixExecutionStrategyImpl'}) ex_d = data.get('execution-strategy', {}) XML.SubElement(root, 'combinationFilter').text = \ str(ex_d.get('combination-filter', '')).rstrip() XML.SubElement(ex_r, 'runSequentially').text = \ str(ex_d.get('sequential', 'false')).lower() if 'touchstone' in ex_d: XML.SubElement(ex_r, 'touchStoneCombinationFilter').text = \ str(ex_d['touchstone'].get('expr', '')) t_r = XML.SubElement(ex_r, 'touchStoneResultCondition') n = ex_d['touchstone'].get('result', 'stable').upper() if n not in ('STABLE', 'UNSTABLE'): raise ValueError('Required result must be stable or unstable') XML.SubElement(t_r, 'name').text = n if n == "STABLE": XML.SubElement(t_r, 'ordinal').text = '0' XML.SubElement(t_r, 'color').text = 'BLUE' else: XML.SubElement(t_r, 'ordinal').text = '1' XML.SubElement(t_r, 'color').text = 'YELLOW' ax_root = XML.SubElement(root, 'axes') for axis_ in data.get('axes', []): axis = axis_['axis'] if axis['type'] not in self.supported_axis: raise ValueError('Only %s axes types are supported' % self.supported_axis.keys()) axis_name = self.supported_axis.get(axis['type']) lbl_root = XML.SubElement(ax_root, axis_name) 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) return root jenkins-job-builder-0.5.0/jenkins_jobs/modules/reporters.py0000664000175300017540000000514112160635010025226 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. """ Reporters are like publishers but only applicable to Maven projets. **Component**: reporters :Macro: reporter :Entry Point: jenkins_jobs.reporters Example:: job: name: test_job project-type: maven reporters: - email: recipients: breakage@example.com """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base def email(parser, xml_parent, data): """yaml: email Email notifications on build failure. :arg str recipients: Recipient email addresses :arg bool notify-every-unstable-build: Send an email for every unstable build (default true) :arg bool send-to-individuals: Send an email to the individual who broke the build (default false) Example:: reporters: - email: recipients: breakage@example.com """ mailer = XML.SubElement(xml_parent, 'hudson.maven.reporters.Mailer') XML.SubElement(mailer, 'recipients').text = data['recipients'] # Note the logic reversal (included here to match the GUI if data.get('notify-every-unstable-build', True): XML.SubElement(mailer, 'dontNotifyEveryUnstableBuild').text = 'false' else: XML.SubElement(mailer, 'dontNotifyEveryUnstableBuild').text = 'true' XML.SubElement(mailer, 'sendToIndividuals').text = str( data.get('send-to-individuals', False)).lower() # TODO: figure out what this is: XML.SubElement(mailer, 'perModuleEmail').text = 'true' class Reporters(jenkins_jobs.modules.base.Base): sequence = 55 component_type = 'reporter' component_list_type = 'reporters' def gen_xml(self, parser, xml_parent, data): if 'reporters' not in data: return if xml_parent.tag != 'maven2-moduleset': raise Exception("Reporters may only be used for Maven modules.") reporters = XML.SubElement(xml_parent, 'reporters') for action in data.get('reporters', []): self.registry.dispatch('reporter', parser, reporters, action) jenkins-job-builder-0.5.0/jenkins_jobs/modules/publishers.py0000664000175300017540000021112012160635010025355 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2012 Varnish Software AS # # 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. """ Publishers define actions that the Jenkins job should perform after the build is complete. **Component**: publishers :Macro: publisher :Entry Point: jenkins_jobs.publishers Example:: job: name: test_job publishers: - scp: site: 'example.com' source: 'doc/build/html/**/*' target_path: 'project' """ import xml.etree.ElementTree as XML import jenkins_jobs.modules.base import logging import sys def archive(parser, xml_parent, data): """yaml: archive Archive build artifacts :arg str artifacts: path specifier for artifacts to archive :arg str excludes: path specifier for artifacts to exclude :arg bool latest-only: only keep the artifacts from the latest successful build Example:: publishers: - archive: artifacts: '*.tar.gz' """ logger = logging.getLogger("%s:archive" % __name__) archiver = XML.SubElement(xml_parent, 'hudson.tasks.ArtifactArchiver') artifacts = XML.SubElement(archiver, 'artifacts') artifacts.text = data['artifacts'] if 'excludes' in data: excludes = XML.SubElement(archiver, 'excludes') excludes.text = data['excludes'] latest = XML.SubElement(archiver, 'latestOnly') # backward compatibility latest_only = data.get('latest_only', False) if 'latest_only' in data: logger.warn('latest_only is deprecated please use latest-only') if 'latest-only' in data: latest_only = data['latest-only'] if latest_only: latest.text = 'true' else: latest.text = 'false' def trigger_parameterized_builds(parser, xml_parent, data): """yaml: trigger-parameterized-builds Trigger parameterized builds of other jobs. Requires the Jenkins `Parameterized Trigger Plugin. `_ :arg str project: name of the job to trigger :arg str predefined-parameters: parameters to pass to the other job (optional) :arg bool current-parameters: Whether to include the parameters passed to the current build to the triggered job (optional) :arg bool svn-revision: Pass svn revision to the triggered job (optional) :arg bool git-revision: Pass git revision to the other job (optional) :arg str condition: when to trigger the other job (default 'ALWAYS') :arg str property-file: Use properties from file (optional) Example:: publishers: - trigger-parameterized-builds: - project: other_job, foo, bar predefined-parameters: foo=bar - project: other_job1, other_job2 predefined-parameters: BUILD_NUM=${BUILD_NUMBER} property-file: version.prop - project: yet_another_job predefined-parameters: foo=bar git-revision: true """ tbuilder = XML.SubElement(xml_parent, 'hudson.plugins.parameterizedtrigger.' 'BuildTrigger') configs = XML.SubElement(tbuilder, 'configs') for project_def in data: tconfig = XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.' 'BuildTriggerConfig') tconfigs = XML.SubElement(tconfig, 'configs') if ('predefined-parameters' in project_def or 'git-revision' in project_def or 'property-file' in project_def or 'current-parameters' in project_def or 'svn-revision' in project_def): if 'predefined-parameters' in project_def: params = XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'PredefinedBuildParameters') properties = XML.SubElement(params, 'properties') properties.text = project_def['predefined-parameters'] if 'git-revision' in project_def and project_def['git-revision']: params = XML.SubElement(tconfigs, 'hudson.plugins.git.' 'GitRevisionBuildParameters') properties = XML.SubElement(params, 'combineQueuedCommits') properties.text = 'false' if 'property-file' in project_def and project_def['property-file']: params = XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'FileBuildParameters') properties = XML.SubElement(params, 'propertiesFile') properties.text = project_def['property-file'] if ('current-parameters' in project_def and project_def['current-parameters']): XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'CurrentBuildParameters') if 'svn-revision' in project_def and project_def['svn-revision']: XML.SubElement(tconfigs, 'hudson.plugins.parameterizedtrigger.' 'SubversionRevisionBuildParameters') else: tconfigs.set('class', 'java.util.Collections$EmptyList') projects = XML.SubElement(tconfig, 'projects') projects.text = project_def['project'] condition = XML.SubElement(tconfig, 'condition') condition.text = project_def.get('condition', 'ALWAYS') trigger_with_no_params = XML.SubElement(tconfig, 'triggerWithNoParameters') trigger_with_no_params.text = 'false' def trigger(parser, xml_parent, data): """yaml: trigger Trigger non-parametrised builds of other jobs. :arg str project: name of the job to trigger :arg str threshold: when to trigger the other job (default 'SUCCESS'), alternatives: SUCCESS, UNSTABLE, FAILURE Example:: publishers: - trigger: project: other_job """ thresholds = { 'SUCCESS': { 'ordinal': '0', 'color': 'BLUE' }, 'UNSTABLE': { 'ordinal': '1', 'color': 'YELLOW' }, 'FAILURE': { 'ordinal': '2', 'color': 'RED' } } tconfig = XML.SubElement(xml_parent, 'hudson.tasks.BuildTrigger') childProjects = XML.SubElement(tconfig, 'childProjects') childProjects.text = data['project'] tthreshold = XML.SubElement(tconfig, 'threshold') threshold = data.get('threshold', 'SUCCESS') if threshold not in thresholds.keys(): raise Exception("threshold must be one of " + ", ".join(threshold.keys())) tname = XML.SubElement(tthreshold, 'name') tname.text = threshold tordinal = XML.SubElement(tthreshold, 'ordinal') tordinal.text = thresholds[threshold]['ordinal'] tcolor = XML.SubElement(tthreshold, 'color') tcolor.text = thresholds[threshold]['color'] def coverage(parser, xml_parent, data): """yaml: coverage WARNING: The coverage function is deprecated. Instead, use the cobertura function to generate a cobertura coverage report. Requires the Jenkins `Cobertura Coverage Plugin. `_ Example:: publishers: - coverage """ logger = logging.getLogger(__name__) logger.warn("Coverage function is deprecated. Switch to cobertura.") cobertura = XML.SubElement(xml_parent, 'hudson.plugins.cobertura.CoberturaPublisher') XML.SubElement(cobertura, 'coberturaReportFile').text = '**/coverage.xml' XML.SubElement(cobertura, 'onlyStable').text = 'false' healthy = XML.SubElement(cobertura, 'healthyTarget') targets = XML.SubElement(healthy, 'targets', { 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'CONDITIONAL' XML.SubElement(entry, 'int').text = '70' entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'LINE' XML.SubElement(entry, 'int').text = '80' entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'METHOD' XML.SubElement(entry, 'int').text = '80' unhealthy = XML.SubElement(cobertura, 'unhealthyTarget') targets = XML.SubElement(unhealthy, 'targets', { 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'CONDITIONAL' XML.SubElement(entry, 'int').text = '0' entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'LINE' XML.SubElement(entry, 'int').text = '0' entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'METHOD' XML.SubElement(entry, 'int').text = '0' failing = XML.SubElement(cobertura, 'failingTarget') targets = XML.SubElement(failing, 'targets', { 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'CONDITIONAL' XML.SubElement(entry, 'int').text = '0' entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'LINE' XML.SubElement(entry, 'int').text = '0' entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.CoverageMetric' ).text = 'METHOD' XML.SubElement(entry, 'int').text = '0' XML.SubElement(cobertura, 'sourceEncoding').text = 'ASCII' def cobertura(parser, xml_parent, data): """yaml: cobertura Generate a cobertura coverage report. Requires the Jenkins `Cobertura Coverage Plugin. `_ :arg str report-file: This is a file name pattern that can be used to locate the cobertura xml report files (optional) :arg bool only-stable: Include only stable builds (default false) :arg bool fail-no-reports: fail builds if no coverage reports are found (default false) :arg bool fail-unhealthy: Unhealthy projects will be failed (default false) :arg bool fail-unstable: Unstable projects will be failed (default false) :arg bool health-auto-update: Auto update threshold for health on successful build (default false) :arg bool stability-auto-update: Auto update threshold for stability on successful build (default false) :arg bool zoom-coverage-chart: Zoom the coverage chart and crop area below the minimum and above the maximum coverage of the past reports (default false) :arg str source-encoding: Override the source encoding (default ASCII) :arg dict targets: :targets: (packages, files, classes, method, line, conditional) * **healthy** (`int`): Healthy threshold (default 0) * **unhealthy** (`int`): Unhealthy threshold (default 0) * **failing** (`int`): Failing threshold (default 0) Example:: publishers: - cobertura: report-file: "/reports/cobertura/coverage.xml" only-stable: "true" fail-no-reports: "true" fail-unhealthy: "true" fail-unstable: "true" health-auto-update: "true" stability-auto-update: "true" zoom-coverage-chart: "true" source-encoding: "Big5" targets: - files: healthy: 10 unhealthy: 20 failing: 30 - method: healthy: 50 unhealthy: 40 failing: 30 """ cobertura = XML.SubElement(xml_parent, 'hudson.plugins.cobertura.CoberturaPublisher') XML.SubElement(cobertura, 'coberturaReportFile').text = data.get( 'report-file', '**/coverage.xml') XML.SubElement(cobertura, 'onlyStable').text = str( data.get('only-stable', 'false')).lower() XML.SubElement(cobertura, 'failUnhealthy').text = str( data.get('fail-unhealthy', 'false')).lower() XML.SubElement(cobertura, 'failUnstable').text = str( data.get('fail-unstable', 'false')).lower() XML.SubElement(cobertura, 'autoUpdateHealth').text = str( data.get('health-auto-update', 'false')).lower() XML.SubElement(cobertura, 'autoUpdateStability').text = str( data.get('stability-auto-update', 'false')).lower() XML.SubElement(cobertura, 'zoomCoverageChart').text = str( data.get('zoom-coverage-chart', 'false')).lower() XML.SubElement(cobertura, 'failNoReports').text = str( data.get('fail-no-reports', 'false')).lower() healthy = XML.SubElement(cobertura, 'healthyTarget') targets = XML.SubElement(healthy, 'targets', { 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) for item in data['targets']: item_name = item.keys()[0] item_values = item.get(item_name, 0) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.' 'CoverageMetric').text = str(item_name).upper() XML.SubElement(entry, 'int').text = str(item_values.get('healthy', 0)) unhealthy = XML.SubElement(cobertura, 'unhealthyTarget') targets = XML.SubElement(unhealthy, 'targets', { 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) for item in data['targets']: item_name = item.keys()[0] item_values = item.get(item_name, 0) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.' 'CoverageMetric').text = str(item_name).upper() XML.SubElement(entry, 'int').text = str(item_values.get('unhealthy', 0)) failing = XML.SubElement(cobertura, 'failingTarget') targets = XML.SubElement(failing, 'targets', { 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) for item in data['targets']: item_name = item.keys()[0] item_values = item.get(item_name, 0) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.' 'CoverageMetric').text = str(item_name).upper() XML.SubElement(entry, 'int').text = str(item_values.get('failing', 0)) XML.SubElement(cobertura, 'sourceEncoding').text = data.get( 'source-encoding', 'ASCII') def ftp(parser, xml_parent, data): """yaml: ftp Upload files via FTP. Requires the Jenkins `Publish over FTP Plugin. `_ :arg str site: name of the ftp 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 transfering files (defaults to False) :arg str source: source path specifier :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:: publishers: - ftp: site: 'ftp.example.com' target: 'dest/dir' source: 'base/source/dir/**' remove-prefix: 'base/source/dir' excludes: '**/*.excludedfiletype' """ console_prefix = 'FTP: ' plugin_tag = 'jenkins.plugins.publish__over__ftp.BapFtpPublisherPlugin' publisher_tag = 'jenkins.plugins.publish__over__ftp.BapFtpPublisher' transfer_tag = 'jenkins.plugins.publish__over__ftp.BapFtpTransfer' plugin_reference_tag = 'jenkins.plugins.publish_over_ftp.' \ 'BapFtpPublisherPlugin' (_, transfer_node) = base_publish_over(xml_parent, data, console_prefix, plugin_tag, publisher_tag, transfer_tag, plugin_reference_tag) XML.SubElement(transfer_node, 'asciiMode').text = 'false' def junit(parser, xml_parent, data): """yaml: junit Publish JUnit test results. :arg str results: results filename Example:: publishers: - junit: results: nosetests.xml """ junitresult = XML.SubElement(xml_parent, 'hudson.tasks.junit.JUnitResultArchiver') XML.SubElement(junitresult, 'testResults').text = data['results'] XML.SubElement(junitresult, 'keepLongStdio').text = "true" XML.SubElement(junitresult, 'testDataPublishers') def xunit(parser, xml_parent, data): """yaml: xunit Publish tests results. Requires the Jenkins `xUnit Plugin. `_ :arg str thresholdmode: whether thresholds represents an absolute \ number of tests or a percentage. Either 'number' or 'percent', will \ default to 'number' if omitted. :arg dict thresholds: list containing the thresholds for both \ 'failed' and 'skipped' tests. Each entry should in turn have a \ list of "threshold name: values". The threshold names are \ 'unstable', 'unstablenew', 'failure', 'failurenew'. Omitting a \ value will resort on xUnit default value (should be 0). :arg dict types: per framework configuration. The key should be \ one of the internal types we support:\ 'aunit', 'boosttest', 'checktype', 'cpptest', 'cppunit', 'fpcunit', \ 'junit', 'mstest', 'nunit', 'phpunit', 'tusar', 'unittest', 'valgrind'. \ The 'custom' type is not supported. Each framework type can be configured using the following parameters: :arg str pattern: An Ant pattern to look for Junit result files, \ relative to the workspace root. :arg bool requireupdate: fail the build whenever fresh tests \ results have not been found (default: true). :arg bool deleteoutput: delete temporary JUnit files (default: true) :arg bool stoponerror: Fail the build whenever an error occur during \ a result file processing (default: true). Example:: publishers: - xunit: thresholdmode: 'percent' thresholds: - failed: unstable: 0 unstablenew: 0 failure: 0 failurenew: 0 - skipped: unstable: 0 unstablenew: 0 failure: 0 failurenew: 0 types: - phpunit: pattern: junit.log - cppUnit: pattern: cppunit.log """ logger = logging.getLogger(__name__) xunit = XML.SubElement(xml_parent, 'xunit') # Map our internal types to the XML element names used by Jenkins plugin types_to_plugin_types = { 'aunit': 'AUnitJunitHudsonTestType', 'boosttest': 'AUnitJunitHudsonTestType', 'checktype': 'CheckType', 'cpptest': 'CppTestJunitHudsonTestType', 'cppunit': 'CppUnitJunitHudsonTestType', 'fpcunit': 'FPCUnitJunitHudsonTestType', 'junit': 'JUnitType', 'mstest': 'MSTestJunitHudsonTestType', 'nunit': 'NUnitJunitHudsonTestType', 'phpunit': 'PHPUnitJunitHudsonTestType', 'tusar': 'TUSARJunitHudsonTestType', 'unittest': 'UnitTestJunitHudsonTestType', 'valgrind': 'ValgrindJunitHudsonTestType', # FIXME should implement the 'custom' type } implemented_types = types_to_plugin_types.keys() # shortcut # Unit framework we are going to generate xml for supported_types = [] for configured_type in data['types']: type_name = configured_type.keys()[0] if type_name not in implemented_types: logger.warn("Requested xUnit type '%s' is not yet supported" % type_name) else: # Append for generation supported_types.append(configured_type) # Generate XML for each of the supported framework types for supported_type in supported_types: framework_name = supported_type.keys()[0] xmltypes = XML.SubElement(xunit, 'types') xmlframework = XML.SubElement(xmltypes, types_to_plugin_types[framework_name]) XML.SubElement(xmlframework, 'pattern').text = \ supported_type[framework_name].get('pattern', '') XML.SubElement(xmlframework, 'failIfNotNew').text = \ str(supported_type[framework_name].get( 'requireupdate', 'true')).lower() XML.SubElement(xmlframework, 'deleteOutputFiles').text = \ str(supported_type[framework_name].get( 'deleteoutput', 'true')).lower() XML.SubElement(xmlframework, 'stopProcessingIfError').text = \ str(supported_type[framework_name].get( 'stoponerror', 'true')).lower() xmlthresholds = XML.SubElement(xunit, 'thresholds') if 'thresholds' in data: for t in data['thresholds']: if not ('failed' in t or 'skipped' in t): logger.warn( "Unrecognized threshold, should be 'failed' or 'skipped'") continue elname = "org.jenkinsci.plugins.xunit.threshold.%sThreshold" \ % t.keys()[0].title() el = XML.SubElement(xmlthresholds, elname) for threshold_name, threshold_value in t.values()[0].items(): # Normalize and craft the element name for this threshold elname = "%sThreshold" % threshold_name.lower().replace( 'new', 'New') XML.SubElement(el, elname).text = threshold_value # Whether to use percent of exact number of tests. # Thresholdmode is either: # - 1 : absolute (number of tests), default. # - 2 : relative (percentage of tests) thresholdmode = '1' if 'percent' == data.get('thresholdmode', 'number'): thresholdmode = '2' XML.SubElement(xunit, 'thresholdMode').text = \ thresholdmode def _violations_add_entry(xml_parent, name, data): vmin = data.get('min', 10) vmax = data.get('max', 999) vunstable = data.get('unstable', 999) pattern = data.get('pattern', None) entry = XML.SubElement(xml_parent, 'entry') XML.SubElement(entry, 'string').text = name tconfig = XML.SubElement(entry, 'hudson.plugins.violations.TypeConfig') XML.SubElement(tconfig, 'type').text = name XML.SubElement(tconfig, 'min').text = str(vmin) XML.SubElement(tconfig, 'max').text = str(vmax) XML.SubElement(tconfig, 'unstable').text = str(vunstable) XML.SubElement(tconfig, 'usePattern').text = 'false' if pattern: XML.SubElement(tconfig, 'pattern').text = pattern else: XML.SubElement(tconfig, 'pattern') def violations(parser, xml_parent, data): """yaml: violations Publish code style violations. Requires the Jenkins `Violations Plugin. `_ The violations component accepts any number of dictionaries keyed by the name of the violations system. The dictionary has the following values: :arg int min: sunny threshold :arg int max: stormy threshold :arg int unstable: unstable threshold :arg str pattern: report filename pattern Any system without a dictionary provided will use default values. Valid systems are: checkstyle, codenarc, cpd, cpplint, csslint, findbugs, fxcop, gendarme, jcreport, jslint, pep8, pmd, pylint, simian, stylecop Example:: publishers: - violations: pep8: min: 0 max: 1 unstable: 1 pattern: '**/pep8.txt' """ violations = XML.SubElement(xml_parent, 'hudson.plugins.violations.' 'ViolationsPublisher') config = XML.SubElement(violations, 'config') suppressions = XML.SubElement(config, 'suppressions', {'class': 'tree-set'}) XML.SubElement(suppressions, 'no-comparator') configs = XML.SubElement(config, 'typeConfigs') XML.SubElement(configs, 'no-comparator') for name in [ 'checkstyle', 'codenarc', 'cpd', 'cpplint', 'csslint', 'findbugs', 'fxcop', 'gendarme', 'jcreport', 'jslint', 'pep8', 'pmd', 'pylint', 'simian', 'stylecop']: _violations_add_entry(configs, name, data.get(name, {})) XML.SubElement(config, 'limit').text = '100' XML.SubElement(config, 'sourcePathPattern') XML.SubElement(config, 'fauxProjectPath') XML.SubElement(config, 'encoding').text = 'default' def checkstyle(parser, xml_parent, data): """yaml: checkstyle Publish trend reports with Checkstyle. Requires the `Checkstyle Plugin. `_ The checkstyle component accepts a dictionary with the following values: :arg str pattern: report filename pattern :arg bool canRunOnFailed: also runs for failed builds (instead of just stable or unstable builds) :arg bool shouldDetectModules: :arg int healthy: sunny threshold :arg int unHealthy: stormy threshold :arg str healthThreshold: threshold priority for health status (high: only high, normal: high and normal, low: all) :arg dict thresholds: :thresholds: * **unstable** (`dict`) :unstable: * **totalAll** (`int`) * **totalHigh** (`int`) * **totalNormal** (`int`) * **totalLow** (`int`) * **failed** (`dict`) :failed: * **totalAll** (`int`) * **totalHigh** (`int`) * **totalNormal** (`int`) * **totalLow** (`int`) :arg str defaultEncoding: encoding for parsing or showing files (empty will use platform default) Example:: publishers: - checkstyle: pattern: '**/checkstyle-result.xml' healthy: 0 unHealthy: 100 healthThreshold: 'high' thresholds: unstable: totalHigh: 10 failed: totalHigh: 1 """ checkstyle = XML.SubElement(xml_parent, 'hudson.plugins.checkstyle.' 'CheckStylePublisher') dval = data.get('healthy', None) if dval: XML.SubElement(checkstyle, 'healthy').text = str(dval) else: XML.SubElement(checkstyle, 'healthy') dval = data.get('unHealthy', None) if dval: XML.SubElement(checkstyle, 'unHealthy').text = str(dval) else: XML.SubElement(checkstyle, 'unHealthy') XML.SubElement(checkstyle, 'thresholdLimit').text = \ data.get('healthThreshold', 'low') XML.SubElement(checkstyle, 'pluginName').text = '[CHECKSTYLE] ' XML.SubElement(checkstyle, 'defaultEncoding').text = \ data.get('defaultEncoding', '') if data.get('canRunOnFailed', False): XML.SubElement(checkstyle, 'canRunOnFailed').text = 'true' else: XML.SubElement(checkstyle, 'canRunOnFailed').text = 'false' XML.SubElement(checkstyle, 'useStableBuildAsReference').text = 'false' XML.SubElement(checkstyle, 'useDeltaValues').text = 'false' dthresholds = data.get('thresholds', {}) dunstable = dthresholds.get('unstable', {}) dfailed = dthresholds.get('failed', {}) thresholds = XML.SubElement(checkstyle, 'thresholds') dval = dunstable.get('totalAll', None) if dval: XML.SubElement(thresholds, 'unstableTotalAll').text = str(dval) else: XML.SubElement(thresholds, 'unstableTotalAll') dval = dunstable.get('totalHigh', None) if dval: XML.SubElement(thresholds, 'unstableTotalHigh').text = str(dval) else: XML.SubElement(thresholds, 'unstableTotalHigh') dval = dunstable.get('totalNormal', None) if dval: XML.SubElement(thresholds, 'unstableTotalNormal').text = str(dval) else: XML.SubElement(thresholds, 'unstableTotalNormal') dval = dunstable.get('totalLow', None) if dval: XML.SubElement(thresholds, 'unstableTotalLow').text = str(dval) else: XML.SubElement(thresholds, 'unstableTotalLow') dval = dfailed.get('totalAll', None) if dval: XML.SubElement(thresholds, 'failedTotalAll').text = str(dval) else: XML.SubElement(thresholds, 'failedTotalAll') dval = dfailed.get('totalHigh', None) if dval: XML.SubElement(thresholds, 'failedTotalHigh').text = str(dval) else: XML.SubElement(thresholds, 'failedTotalHigh') dval = dfailed.get('totalNormal', None) if dval: XML.SubElement(thresholds, 'failedTotalNormal').text = str(dval) else: XML.SubElement(thresholds, 'failedTotalNormal') dval = dfailed.get('totalLow', None) if dval: XML.SubElement(thresholds, 'failedTotalLow').text = str(dval) else: XML.SubElement(thresholds, 'failedTotalLow') if data.get('shouldDetectModules', False): XML.SubElement(checkstyle, 'shouldDetectModules').text = 'true' else: XML.SubElement(checkstyle, 'shouldDetectModules').text = 'false' XML.SubElement(checkstyle, 'dontComputeNew').text = 'true' XML.SubElement(checkstyle, 'doNotResolveRelativePaths').text = 'false' XML.SubElement(checkstyle, 'pattern').text = data.get('pattern', '') def scp(parser, xml_parent, data): """yaml: scp Upload files via SCP Requires the Jenkins `SCP Plugin. `_ :arg str site: name of the scp site :arg str target: destination directory :arg str source: source path specifier :arg bool keep-hierarchy: keep the file hierarchy when uploading (default false) :arg bool copy-after-failure: copy files even if the job fails (default false) :arg bool copy-console: copy the console log (default false); if specified, omit 'target' Example:: publishers: - scp: site: 'example.com' target: 'dest/dir' source: 'base/source/dir/**' """ site = data['site'] scp = XML.SubElement(xml_parent, 'be.certipost.hudson.plugin.SCPRepositoryPublisher') XML.SubElement(scp, 'siteName').text = site entries = XML.SubElement(scp, 'entries') for entry in data['files']: entry_e = XML.SubElement(entries, 'be.certipost.hudson.plugin.Entry') XML.SubElement(entry_e, 'filePath').text = entry['target'] XML.SubElement(entry_e, 'sourceFile').text = entry.get('source', '') if entry.get('keep-hierarchy', False): XML.SubElement(entry_e, 'keepHierarchy').text = 'true' else: XML.SubElement(entry_e, 'keepHierarchy').text = 'false' if entry.get('copy-console', False): XML.SubElement(entry_e, 'copyConsoleLog').text = 'true' else: XML.SubElement(entry_e, 'copyConsoleLog').text = 'false' if entry.get('copy-after-failure', False): XML.SubElement(entry_e, 'copyAfterFailure').text = 'true' else: XML.SubElement(entry_e, 'copyAfterFailure').text = 'false' def ssh(parser, xml_parent, data): """yaml: ssh Upload files via SCP. 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 transfering files (defaults to False) :arg str source: source path specifier :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:: publishers: - ssh: site: 'server.example.com' target: 'dest/dir' source: 'base/source/dir/**' remove-prefix: 'base/source/dir' excludes: '**/*.excludedfiletype' """ console_prefix = 'SSH: ' plugin_tag = 'jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin' publisher_tag = 'jenkins.plugins.publish__over__ssh.BapSshPublisher' transfer_tag = 'jenkins.plugins.publish__over__ssh.BapSshTransfer' plugin_reference_tag = 'jenkins.plugins.publish_over_ssh.' \ 'BapSshPublisherPlugin' base_publish_over(xml_parent, data, console_prefix, plugin_tag, publisher_tag, transfer_tag, plugin_reference_tag) def pipeline(parser, xml_parent, data): """yaml: pipeline Specify a downstream project in a pipeline. Requires the Jenkins `Build Pipeline Plugin. `_ :Parameter: the name of the downstream project Example:: publishers: - pipleline: deploy You can build pipeline jobs that are re-usable in different pipelines by using a :ref:`job-template` to define the pipeline jobs, and variable substitution to specify the name of the downstream job in the pipeline. Job-specific substitutions are useful here (see :ref:`project`). See 'samples/pipeline.yaml' for an example pipeline implementation. """ if data != '': pippub = XML.SubElement(xml_parent, 'au.com.centrumsystems.hudson.plugin.' 'buildpipeline.trigger.BuildPipelineTrigger') XML.SubElement(pippub, 'downstreamProjectNames').text = data def email(parser, xml_parent, data): """yaml: email Email notifications on build failure. :arg str recipients: Recipient email addresses :arg bool notify-every-unstable-build: Send an email for every unstable build (default true) :arg bool send-to-individuals: Send an email to the individual who broke the build (default false) Example:: publishers: - email: recipients: breakage@example.com """ # TODO: raise exception if this is applied to a maven job mailer = XML.SubElement(xml_parent, 'hudson.tasks.Mailer') XML.SubElement(mailer, 'recipients').text = data['recipients'] # Note the logic reversal (included here to match the GUI if data.get('notify-every-unstable-build', True): XML.SubElement(mailer, 'dontNotifyEveryUnstableBuild').text = 'false' else: XML.SubElement(mailer, 'dontNotifyEveryUnstableBuild').text = 'true' XML.SubElement(mailer, 'sendToIndividuals').text = str( data.get('send-to-individuals', False)).lower() def claim_build(parser, xml_parent, data): """yaml: claim-build Claim build failures Requires the Jenkins `Claim Plugin. `_ Example:: publishers: - claim-build """ XML.SubElement(xml_parent, 'hudson.plugins.claim.ClaimPublisher') def base_email_ext(parser, xml_parent, data, ttype): trigger = XML.SubElement(xml_parent, 'hudson.plugins.emailext.plugins.trigger.' + ttype) email = XML.SubElement(trigger, 'email') XML.SubElement(email, 'recipientList').text = '' XML.SubElement(email, 'subject').text = '$PROJECT_DEFAULT_SUBJECT' XML.SubElement(email, 'body').text = '$PROJECT_DEFAULT_CONTENT' XML.SubElement(email, 'sendToDevelopers').text = 'false' XML.SubElement(email, 'sendToRequester').text = 'false' XML.SubElement(email, 'includeCulprits').text = 'false' XML.SubElement(email, 'sendToRecipientList').text = 'true' def email_ext(parser, xml_parent, data): """yaml: email-ext Extend Jenkin's built in email notification Requires the Jenkins `Email-ext Plugin. `_ :arg str recipients: Comma separated list of emails :arg str reply-to: Comma separated list of emails that should be in the Reply-To header for this project (default is $DEFAULT_RECIPIENTS) :arg str subject: Subject for the email, can include variables like ${BUILD_NUMBER} or even groovy or javascript code :arg str body: Content for the body of the email, can include variables like ${BUILD_NUMBER}, but the real magic is using groovy or javascript to hook into the Jenkins API itself :arg bool attach-build-log: Include build log in the email (default false) :arg bool unstable: Send an email for an unstable result (default false) :arg bool first-failure: Send an email for just the first failure (default false) :arg bool not-built: Send an email if not built (default false) :arg bool aborted: Send an email if the build is aborted (default false) :arg bool regression: Send an email if there is a regression (default false) :arg bool failure: Send an email if the build fails (default true) :arg bool improvement: Send an email if the build improves (default false) :arg bool still-failing: Send an email if the build is still failing (default false) :arg bool success: Send an email for a successful build (default false) :arg bool fixed: Send an email if the build is fixed (default false) :arg bool still-unstable: Send an email if the build is still unstable (default false) :arg bool pre-build: Send an email before the build (default false) Example:: publishers: - email-ext: recipients: foo@example.com, bar@example.com reply-to: foo@example.com subject: Subject for Build ${BUILD_NUMBER} body: The build has finished attach-build-log: false unstable: true first-failure: true not-built: true aborted: true regression: true failure: true improvement: true still-failing: true success: true fixed: true still-unstable: true pre-build: true """ emailext = XML.SubElement(xml_parent, 'hudson.plugins.emailext.ExtendedEmailPublisher') if 'recipients' in data: XML.SubElement(emailext, 'recipientList').text = data['recipients'] else: XML.SubElement(emailext, 'recipientList').text = '$DEFAULT_RECIPIENTS' ctrigger = XML.SubElement(emailext, 'configuredTriggers') if data.get('unstable', False): base_email_ext(parser, ctrigger, data, 'UnstableTrigger') if data.get('first-failure', False): base_email_ext(parser, ctrigger, data, 'FirstFailureTrigger') if data.get('not-built', False): base_email_ext(parser, ctrigger, data, 'NotBuiltTrigger') if data.get('aborted', False): base_email_ext(parser, ctrigger, data, 'AbortedTrigger') if data.get('regression', False): base_email_ext(parser, ctrigger, data, 'RegressionTrigger') if data.get('failure', True): base_email_ext(parser, ctrigger, data, 'FailureTrigger') if data.get('improvement', False): base_email_ext(parser, ctrigger, data, 'ImprovementTrigger') if data.get('still-failing', False): base_email_ext(parser, ctrigger, data, 'StillFailingTrigger') if data.get('success', False): base_email_ext(parser, ctrigger, data, 'SuccessTrigger') if data.get('fixed', False): base_email_ext(parser, ctrigger, data, 'FixedTrigger') if data.get('still-unstable', False): base_email_ext(parser, ctrigger, data, 'StillUnstableTrigger') if data.get('pre-build', False): base_email_ext(parser, ctrigger, data, 'PreBuildTrigger') XML.SubElement(emailext, 'contentType').text = 'default' XML.SubElement(emailext, 'defaultSubject').text = data.get( 'subject', '$DEFAULT_SUBJECT') XML.SubElement(emailext, 'defaultContent').text = data.get( 'body', '$DEFAULT_CONTENT') XML.SubElement(emailext, 'attachmentsPattern').text = '' XML.SubElement(emailext, 'presendScript').text = '' XML.SubElement(emailext, 'attachBuildLog').text = \ str(data.get('attach-build-log', False)).lower() XML.SubElement(emailext, 'replyTo').text = data.get('reply-to', '$DEFAULT_RECIPIENTS') def fingerprint(parser, xml_parent, data): """yaml: fingerprint Fingerprint files to track them across builds :arg str files: files to fingerprint, follows the @includes of Ant fileset (default is blank) :arg bool record-artifacts: fingerprint all archived artifacts (default false) Example:: publishers: - fingerprint: files: builddir/test*.xml record-artifacts: false """ finger = XML.SubElement(xml_parent, 'hudson.tasks.Fingerprinter') XML.SubElement(finger, 'targets').text = data.get('files', '') XML.SubElement(finger, 'recordBuildArtifacts').text = str(data.get( 'record-artifacts', False)).lower() def aggregate_tests(parser, xml_parent, data): """yaml: aggregate-tests Aggregate downstream test results :arg bool include-failed-builds: whether to include failed builds Example:: publishers: - aggregate-tests: include-failed-builds: true """ agg = XML.SubElement(xml_parent, 'hudson.tasks.test.AggregatedTestResultPublisher') XML.SubElement(agg, 'includeFailedBuilds').text = str(data.get( 'include-failed-builds', False)).lower() def cppcheck(parser, xml_parent, data): """yaml: cppcheck Cppcheck result publisher Requires the Jenkins `Cppcheck Plugin. `_ :arg str pattern: file pattern for cppcheck xml report for more optional parameters see the example Example:: publishers: - cppcheck: pattern: "**/cppcheck.xml" # the rest is optional # build status (new) error count thresholds thresholds: unstable: 5 new-unstable: 5 failure: 7 new-failure: 3 # severities which count towards the threshold, default all true severity: error: true warning: true information: false graph: xysize: [500, 200] # which errors to display, default only sum display: sum: false error: true """ cppextbase = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.cppcheck.' 'CppcheckPublisher') cppext = XML.SubElement(cppextbase, 'cppcheckConfig') XML.SubElement(cppext, 'pattern').text = data['pattern'] XML.SubElement(cppext, 'ignoreBlankFiles').text = \ str(data.get('ignoreblankfiles', 'false')).lower() csev = XML.SubElement(cppext, 'configSeverityEvaluation') thrsh = data.get('thresholds', {}) XML.SubElement(csev, 'threshold').text = str(thrsh.get('unstable', '')) XML.SubElement(csev, 'newThreshold').text = \ str(thrsh.get('new-unstable', '')) XML.SubElement(csev, 'failureThreshold').text = \ str(thrsh.get('failure', '')) XML.SubElement(csev, 'newFailureThreshold').text = \ str(thrsh.get('new-failure', '')) XML.SubElement(csev, 'healthy').text = str(thrsh.get('healthy', '')) XML.SubElement(csev, 'unHealthy').text = str(thrsh.get('unhealthy', '')) sev = thrsh.get('severity', {}) XML.SubElement(csev, 'severityError').text = \ str(sev.get('error', 'true')).lower() XML.SubElement(csev, 'severityWarning').text = \ str(sev.get('warning', 'true')).lower() XML.SubElement(csev, 'severityStyle').text = \ str(sev.get('style', 'true')).lower() XML.SubElement(csev, 'severityPerformance').text = \ str(sev.get('performance', 'true')).lower() XML.SubElement(csev, 'severityInformation').text = \ str(sev.get('information', 'true')).lower() graph = data.get('graph', {}) cgraph = XML.SubElement(cppext, 'configGraph') x, y = graph.get('xysize', [500, 200]) XML.SubElement(cgraph, 'xSize').text = str(x) XML.SubElement(cgraph, 'ySize').text = str(y) gdisplay = graph.get('display', {}) XML.SubElement(cgraph, 'displayAllErrors').text = \ str(gdisplay.get('sum', 'true')).lower() XML.SubElement(cgraph, 'displayErrorSeverity').text = \ str(gdisplay.get('error', 'false')).lower() XML.SubElement(cgraph, 'displayWarningSeverity').text = \ str(gdisplay.get('warning', 'false')).lower() XML.SubElement(cgraph, 'displayStyleSeverity').text = \ str(gdisplay.get('style', 'false')).lower() XML.SubElement(cgraph, 'displayPerformanceSeverity').text = \ str(gdisplay.get('performance', 'false')).lower() XML.SubElement(cgraph, 'displayInformationSeverity').text = \ str(gdisplay.get('information', 'false')).lower() def logparser(parser, xml_parent, data): """yaml: logparser Requires the Jenkins `Log Parser Plugin. `_ :arg str parse-rules: full path to parse rules :arg bool unstable-on-warning: mark build unstable on warning :arg bool fail-on-error: mark build failed on error Example:: publishers: - logparser: parse-rules: "/path/to/parserules" unstable-on-warning: true fail-on-error: true """ clog = XML.SubElement(xml_parent, 'hudson.plugins.logparser.LogParserPublisher') XML.SubElement(clog, 'unstableOnWarning').text = \ str(data.get('unstable-on-warning', 'false')).lower() XML.SubElement(clog, 'failBuildOnError').text = \ str(data.get('fail-on-error', 'false')).lower() # v1.08: this must be the full path, the name of the rules is not enough XML.SubElement(clog, 'parsingRulesPath').text = data.get('parse-rules', '') def copy_to_master(parser, xml_parent, data): """yaml: copy-to-master Copy files to master from slave Requires the Jenkins `Copy To Slave Plugin. `_ :arg list includes: list of file patterns to copy :arg list excludes: list of file patterns to exclude :arg string destination: absolute path into which the files will be copied. If left blank they will be copied into the workspace of the current job Example:: publishers: - copy-to-master: includes: - file1 - file2*.txt excludes: - file2bad.txt """ p = 'com.michelin.cio.hudson.plugins.copytoslave.CopyToMasterNotifier' cm = XML.SubElement(xml_parent, p) XML.SubElement(cm, 'includes').text = ','.join(data.get('includes', [''])) XML.SubElement(cm, 'excludes').text = ','.join(data.get('excludes', [''])) XML.SubElement(cm, 'destinationFolder').text = \ data.get('destination', '') if data.get('destination', ''): XML.SubElement(cm, 'overrideDestinationFolder').text = 'true' def jira(parser, xml_parent, data): """yaml: jira Update relevant JIRA issues Requires the Jenkins `JIRA Plugin `_ Example:: publishers: - jira """ XML.SubElement(xml_parent, 'hudson.plugins.jira.JiraIssueUpdater') def groovy_postbuild(parser, xml_parent, data): """yaml: groovy-postbuild Execute a groovy script. Requires the Jenkins `Groovy Postbuild Plugin `_ :Parameter: the groovy script to execute Example:: publishers: - groovy-postbuild: "manager.buildFailure()" """ root_tag = 'org.jvnet.hudson.plugins.groovypostbuild.'\ 'GroovyPostbuildRecorder' groovy = XML.SubElement(xml_parent, root_tag) XML.SubElement(groovy, 'groovyScript').text = data def base_publish_over(xml_parent, data, console_prefix, 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') 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'] XML.SubElement(transfersset, 'excludes').text = data.get('excludes', '') XML.SubElement(transfersset, 'removePrefix').text = \ data.get('remove-prefix', '') XML.SubElement(transfersset, 'remoteDirectorySDF').text = \ str(data.get('target-is-date-format', False)).lower() XML.SubElement(transfersset, 'flatten').text = 'false' XML.SubElement(transfersset, 'cleanRemote').text = \ str(data.get('clean-remote', 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 = 'false' XML.SubElement(delegate, 'hostConfigurationAccess', {'class': reference_plugin_tag, 'reference': '../..'}) return (outer, transfersset) def cifs(parser, xml_parent, data): """yaml: cifs Upload files via CIFS. Requires the Jenkins `Publish over CIFS Plugin. `_ :arg str site: name of the cifs site/share :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 transfering files (defaults to False) :arg str source: source path specifier :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:: publishers: - cifs: site: 'cifs.share' target: 'dest/dir' source: 'base/source/dir/**' remove-prefix: 'base/source/dir' excludes: '**/*.excludedfiletype' """ console_prefix = 'CIFS: ' plugin_tag = 'jenkins.plugins.publish__over__cifs.CifsPublisherPlugin' publisher_tag = 'jenkins.plugins.publish__over__cifs.CifsPublisher' transfer_tag = 'jenkins.plugins.publish__over__cifs.CifsTransfer' plugin_reference_tag = 'jenkins.plugins.publish_over_cifs.' \ 'CifsPublisherPlugin' base_publish_over(xml_parent, data, console_prefix, plugin_tag, publisher_tag, transfer_tag, plugin_reference_tag) def sonar(parser, xml_parent, data): """yaml: sonar Sonar plugin support. Requires the Jenkins `Sonar Plugin. `_ :arg str jdk: JDK to use (inherited from the job if omitted). (optional) :arg str branch: branch onto which the analysis will be posted (optional) :arg str language: source code language (optional) :arg str maven-opts: options given to maven (optional) :arg str additional-properties: sonar analysis parameters (optional) :arg dict skip-global-triggers: :Triggers: * **skip-when-scm-change** (`bool`): skip analysis when build triggered by scm * **skip-when-upstream-build** (`bool`): skip analysis when build triggered by an upstream build * **skip-when-envvar-defined** (`str`): skip analysis when the specified environment variable is set to true This publisher supports the post-build action exposed by the Jenkins Sonar Plugin, which is triggering a Sonar Analysis with Maven. Example:: 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 """ sonar = XML.SubElement(xml_parent, 'hudson.plugins.sonar.SonarPublisher') if 'jdk' in data: XML.SubElement(sonar, 'jdk').text = data['jdk'] XML.SubElement(sonar, 'branch').text = data.get('branch', '') XML.SubElement(sonar, 'language').text = data.get('language', '') XML.SubElement(sonar, 'mavenOpts').text = data.get('maven-opts', '') XML.SubElement(sonar, 'jobAdditionalProperties').text = \ data.get('additional-properties', '') if 'skip-global-triggers' in data: data_triggers = data['skip-global-triggers'] triggers = XML.SubElement(sonar, 'triggers') XML.SubElement(triggers, 'skipScmCause').text = \ str(data_triggers.get('skip-when-scm-change', False)).lower() XML.SubElement(triggers, 'skipUpstreamCause').text = \ str(data_triggers.get('skip-when-upstream-build', False)).lower() XML.SubElement(triggers, 'envVar').text = \ data_triggers.get('skip-when-envvar-defined', '') def performance(parser, xml_parent, data): """yaml: performance Publish performance test results from jmeter and junit. Requires the Jenkins `Performance Plugin. `_ :arg int failed-threshold: Specify the error percentage threshold that set the build failed. A negative value means don't use this threshold (default 0) :arg int unstable-threshold: Specify the error percentage threshold that set the build unstable. A negative value means don't use this threshold (default 0) :arg dict report: :(jmeter or junit): (`dict` or `str`): Specify a custom report file (optional; jmeter default \**/*.jtl, junit default **/TEST-\*.xml) Examples:: publishers: - performance: failed-threshold: 85 unstable-threshold: -1 report: - jmeter: "/special/file.jtl" - junit: "/special/file.xml" publishers: - performance: failed-threshold: 85 unstable-threshold: -1 report: - jmeter - junit publishers: - performance: failed-threshold: 85 unstable-threshold: -1 report: - jmeter: "/special/file.jtl" - junit: "/special/file.xml" - jmeter - junit """ logger = logging.getLogger(__name__) perf = XML.SubElement(xml_parent, 'hudson.plugins.performance.' 'PerformancePublisher') XML.SubElement(perf, 'errorFailedThreshold').text = str(data.get( 'failed-threshold', 0)) XML.SubElement(perf, 'errorUnstableThreshold').text = str(data.get( 'unstable-threshold', 0)) parsers = XML.SubElement(perf, 'parsers') for item in data['report']: if isinstance(item, dict): item_name = item.keys()[0] item_values = item.get(item_name, None) if item_name == 'jmeter': jmhold = XML.SubElement(parsers, 'hudson.plugins.performance.' 'JMeterParser') XML.SubElement(jmhold, 'glob').text = str(item_values) elif item_name == 'junit': juhold = XML.SubElement(parsers, 'hudson.plugins.performance.' 'JUnitParser') XML.SubElement(juhold, 'glob').text = str(item_values) else: logger.fatal("You have not specified jmeter or junit, or " "you have incorrectly assigned the key value.") sys.exit(1) elif isinstance(item, str): if item == 'jmeter': jmhold = XML.SubElement(parsers, 'hudson.plugins.performance.' 'JMeterParser') XML.SubElement(jmhold, 'glob').text = '**/*.jtl' elif item == 'junit': juhold = XML.SubElement(parsers, 'hudson.plugins.performance.' 'JUnitParser') XML.SubElement(juhold, 'glob').text = '**/TEST-*.xml' else: logger.fatal("You have not specified jmeter or junit, or " "you have incorrectly assigned the key value.") sys.exit(1) def join_trigger(parser, xml_parent, data): """yaml: join-trigger Trigger a job after all the immediate downstream jobs have completed :arg list projects: list of projects to trigger Example:: publishers: - join-trigger: projects: - project-one - project-two """ jointrigger = XML.SubElement(xml_parent, 'join.JoinTrigger') # Simple Project List joinProjectsText = ','.join(data.get('projects', [''])) XML.SubElement(jointrigger, 'joinProjects').text = joinProjectsText def jabber(parser, xml_parent, data): """yaml: jabber Integrates Jenkins with the Jabber/XMPP instant messaging protocol Requires the Jenkins `Jabber Plugin. `_ :arg bool notify-on-build-start: Whether to send notifications to channels when a build starts (default false) :arg bool notify-scm-committers: Whether to send notifications to the users that are suspected of having broken this build (default false) :arg bool notify-scm-culprits: Also send notifications to 'culprits' from previous unstable/failed builds (default false) :arg bool notify-upstream-committers: Whether to send notifications to upstream committers if no committers were found for a broken build (default false) :arg bool notify-scm-fixers: Whether to send notifications to the users that have fixed a broken build (default false) :arg list group-targets: List of group targets to notify :arg list individual-targets: List of individual targets to notify :arg dict strategy: When to send notifications (default all) :strategy values: * **all** -- Always * **failure** -- On any failure * **failure-fixed** -- On failure and fixes * **change** -- Only on state change :arg dict message: Channel notification message (default summary-scm) :message values: * **summary-scm** -- Summary + SCM changes * **summary** -- Just summary * **summary-build** -- Summary and build parameters * **summary-scm-fail** -- Summary, SCM changes, and failed tests Example:: publishers: - jabber: notify-on-build-start: true group-targets: - "foo-room@conference-2-fooserver.foo.com" individual-targets: - "foo-user@conference-2-fooserver.foo.com" strategy: all message: summary-scm """ j = XML.SubElement(xml_parent, 'hudson.plugins.jabber.im.transport.' 'JabberPublisher') t = XML.SubElement(j, 'targets') if 'group-targets' in data: for group in data['group-targets']: gcimt = XML.SubElement(t, 'hudson.plugins.im.' 'GroupChatIMMessageTarget') XML.SubElement(gcimt, 'name').text = group XML.SubElement(gcimt, 'notificationOnly').text = 'false' if 'individual-targets' in data: for individual in data['individual-targets']: dimt = XML.SubElement(t, 'hudson.plugins.im.' 'DefaultIMMessageTarget') XML.SubElement(dimt, 'value').text = individual strategy = data.get('strategy', 'all') strategydict = {'all': 'ALL', 'failure': 'ANY_FAILURE', 'failure-fixed': 'FAILURE_AND_FIXED', 'change': 'STATECHANGE_ONLY'} if strategy not in strategydict: raise Exception("Strategy entered is not valid, must be one of: " + "all, failure, failure-fixed, or change") XML.SubElement(j, 'strategy').text = strategydict[strategy] XML.SubElement(j, 'notifyOnBuildStart').text = str( data.get('notify-on-build-start', 'false')).lower() XML.SubElement(j, 'notifySuspects').text = str( data.get('notify-scm-committers', 'false')).lower() XML.SubElement(j, 'notifyCulprits').text = str( data.get('notify-scm-culprits', 'false')).lower() XML.SubElement(j, 'notifyFixers').text = str( data.get('notify-scm-fixers', 'false')).lower() XML.SubElement(j, 'notifyUpstreamCommitters').text = str( data.get('notify-upstream-committers', 'false')).lower() message = data.get('message', 'summary-scm') messagedict = {'summary-scm': 'DefaultBuildToChatNotifier', 'summary': 'SummaryOnlyBuildToChatNotifier', 'summary-build': 'BuildParametersBuildToChatNotifier', 'summary-scm-fail': 'PrintFailingTestsBuildToChatNotifier'} if message not in messagedict: raise Exception("Message entered is not valid, must be one of: " + "summary-scm, summary, summary-build " + "of summary-scm-fail") XML.SubElement(j, 'buildToChatNotifier', { 'class': 'hudson.plugins.im.build_notify.' + messagedict[message]}) XML.SubElement(j, 'matrixMultiplier').text = 'ONLY_CONFIGURATIONS' def workspace_cleanup(parser, xml_parent, data): """yaml: workspace-cleanup (post-build) See `Workspace Cleanup Plugin. `_ The pre-build workspace-cleanup is available as a wrapper. :arg list include: list of files to be included :arg list exclude: list of files to be excluded :arg bool dirmatch: Apply pattern to directories too (default: false) :arg list clean-if: clean depending on build status :clean-if values: * **success** (`bool`) (default: true) * **unstable** (`bool`) (default: true) * **failure** (`bool`) (default: true) * **aborted** (`bool`) (default: true) * **not-built** (`bool`) (default: true) :arg bool fail-build: Fail the build if the cleanup fails (default: true) :arg bool clean-parent: Cleanup matrix parent workspace (default: false) Example:: publishers: - workspace-cleanup: include: - "*.zip" clean-if: - success: true - not-built: false """ p = XML.SubElement(xml_parent, 'hudson.plugins.ws__cleanup.WsCleanup') p.set("plugin", "ws-cleanup@0.14") if "include" in data or "exclude" in data: patterns = XML.SubElement(p, 'patterns') for inc in data.get("include", []): ptrn = XML.SubElement(patterns, 'hudson.plugins.ws__cleanup.Pattern') XML.SubElement(ptrn, 'pattern').text = inc XML.SubElement(ptrn, 'type').text = "INCLUDE" for exc in data.get("exclude", []): ptrn = XML.SubElement(patterns, 'hudson.plugins.ws__cleanup.Pattern') XML.SubElement(ptrn, 'pattern').text = exc XML.SubElement(ptrn, 'type').text = "EXCLUDE" XML.SubElement(p, 'deleteDirs').text = \ str(data.get("dirmatch", "false")).lower() XML.SubElement(p, 'cleanupMatrixParent').text = \ str(data.get("clean-parent", "false")).lower() mask = {'success': 'cleanWhenSuccess', 'unstable': 'cleanWhenUnstable', 'failure': 'cleanWhenFailure', 'not-built': 'cleanWhenNotBuilt', 'aborted': 'cleanWhenAborted'} clean = data.get('clean-if', []) cdict = dict() for d in clean: cdict.update(d) for k, v in mask.iteritems(): XML.SubElement(p, v).text = str(cdict.pop(k, True)).lower() if len(cdict) > 0: raise ValueError('clean-if must be one of: %r' % list(mask.keys())) if str(data.get("fail-build", "false")).lower() == 'false': XML.SubElement(p, 'notFailBuild').text = 'true' else: XML.SubElement(p, 'notFailBuild').text = 'false' def maven_deploy(parser, xml_parent, data): """yaml: maven-deploy Deploy artifacts to Maven repository. :arg str id: Repository ID :arg str url: Repository URL :arg bool unique-version: Assign unique versions to snapshots (default true) :arg bool deploy-unstable: Deploy even if the build is unstable (default false) Example:: publishers: - maven-deploy: id: example url: http://repo.example.com/maven2/ unique-version: true deploy-unstable: false """ p = XML.SubElement(xml_parent, 'hudson.maven.RedeployPublisher') XML.SubElement(p, 'id').text = data['id'] XML.SubElement(p, 'url').text = data['url'] XML.SubElement(p, 'uniqueVersion').text = str( data.get('unique-version', 'true')).lower() XML.SubElement(p, 'evenIfUnstable').text = str( data.get('deploy-unstable', 'false')).lower() class Publishers(jenkins_jobs.modules.base.Base): sequence = 70 component_type = 'publisher' component_list_type = 'publishers' def gen_xml(self, parser, xml_parent, data): publishers = XML.SubElement(xml_parent, 'publishers') for action in data.get('publishers', []): self.registry.dispatch('publisher', parser, publishers, action) jenkins-job-builder-0.5.0/jenkins_jobs/errors.py0000664000175300017540000000023212160635010023041 0ustar jenkinsjenkins00000000000000"""Exception classes for jenkins_jobs errors""" class JenkinsJobsException(Exception): pass class YAMLFormatError(JenkinsJobsException): pass jenkins-job-builder-0.5.0/jenkins_jobs/sphinx/0000775000175300017540000000000012160635107022476 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/sphinx/__init__.py0000664000175300017540000000000012160635010024566 0ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/sphinx/yaml.py0000664000175300017540000001147512160635010024013 0ustar jenkinsjenkins00000000000000# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. # Most of this code originated in sphinx.domains.python and # sphinx.ext.autodoc and has been only slightly adapted for use in # subclasses here. # :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. # :license: BSD, see LICENSE for details. import re from sphinx.ext.autodoc import Documenter, FunctionDocumenter from sphinx.domains.python import PyModulelevel, _pseudo_parse_arglist from sphinx import addnodes from sphinx.locale import _ yaml_sig_re = re.compile('yaml:\s*(.*)') class PyYAMLFunction(PyModulelevel): def handle_signature(self, sig, signode): """Transform a Python signature into RST nodes. Return (fully qualified name of the thing, classname if any). If inside a class, the current class name is handled intelligently: * it is stripped from the displayed name if present * it is added to the full name (return value) if not present """ name_prefix = None name = sig arglist = None retann = None # determine module and class name (if applicable), as well as full name modname = self.options.get( 'module', self.env.temp_data.get('py:module')) classname = self.env.temp_data.get('py:class') fullname = name signode['module'] = modname signode['class'] = classname signode['fullname'] = fullname sig_prefix = self.get_signature_prefix(sig) if sig_prefix: signode += addnodes.desc_annotation(sig_prefix, sig_prefix) if name_prefix: signode += addnodes.desc_addname(name_prefix, name_prefix) anno = self.options.get('annotation') signode += addnodes.desc_name(name, name) if not arglist: if self.needs_arglist(): # for callables, add an empty parameter list signode += addnodes.desc_parameterlist() if retann: signode += addnodes.desc_returns(retann, retann) if anno: signode += addnodes.desc_annotation(' ' + anno, ' ' + anno) return fullname, name_prefix _pseudo_parse_arglist(signode, arglist) if retann: signode += addnodes.desc_returns(retann, retann) if anno: signode += addnodes.desc_annotation(' ' + anno, ' ' + anno) return fullname, name_prefix def get_index_text(self, modname, name_cls): return _('%s (in module %s)') % (name_cls[0], modname) class YAMLFunctionDocumenter(FunctionDocumenter): priority = FunctionDocumenter.priority + 10 objtype = 'yamlfunction' directivetype = 'yamlfunction' @classmethod def can_document_member(cls, member, membername, isattr, parent): if not FunctionDocumenter.can_document_member(member, membername, isattr, parent): return False if member.__doc__ is not None and yaml_sig_re.match(member.__doc__): return True return False def _find_signature(self, encoding=None): docstrings = Documenter.get_doc(self, encoding, 2) if len(docstrings) != 1: return doclines = docstrings[0] setattr(self, '__new_doclines', doclines) if not doclines: return # match first line of docstring against signature RE match = yaml_sig_re.match(doclines[0]) if not match: return name = match.group(1) # ok, now jump over remaining empty lines and set the remaining # lines as the new doclines i = 1 while i < len(doclines) and not doclines[i].strip(): i += 1 setattr(self, '__new_doclines', doclines[i:]) return name def get_doc(self, encoding=None, ignore=1): lines = getattr(self, '__new_doclines', None) if lines is not None: return [lines] return Documenter.get_doc(self, encoding, ignore) def format_signature(self): result = self._find_signature() self._name = result return '' def format_name(self): return self._name def setup(app): app.add_autodocumenter(YAMLFunctionDocumenter) app.add_directive_to_domain('py', 'yamlfunction', PyYAMLFunction) jenkins-job-builder-0.5.0/jenkins_jobs/__init__.py0000664000175300017540000000000012160635010023255 0ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/versioninfo0000664000175300017540000000000612160635105023443 0ustar jenkinsjenkins000000000000000.5.0 jenkins-job-builder-0.5.0/jenkins_jobs/builder.py0000664000175300017540000004074312160635010023166 0ustar jenkinsjenkins00000000000000#!/usr/bin/env python # Copyright (C) 2012 OpenStack, LLC. # # 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. # Manage jobs in Jenkins server import os import hashlib import yaml import json import xml.etree.ElementTree as XML from xml.dom import minidom import jenkins import re import pkg_resources import logging import copy import itertools from jenkins_jobs.errors import JenkinsJobsException logger = logging.getLogger(__name__) def deep_format(obj, paramdict): """Apply the paramdict via str.format() to all string objects found within the supplied obj. Lists and dicts are traversed recursively.""" # YAML serialisation was originally used to achieve this, but that places # limitations on the values in paramdict - the post-format result must # still be valid YAML (so substituting-in a string containing quotes, for # example, is problematic). if isinstance(obj, str): ret = obj.format(**paramdict) elif isinstance(obj, list): ret = [] for item in obj: ret.append(deep_format(item, paramdict)) elif isinstance(obj, dict): ret = {} for item in obj: ret[item] = deep_format(obj[item], paramdict) else: ret = obj return ret class YamlParser(object): def __init__(self, config=None): self.registry = ModuleRegistry(config) self.data = {} self.jobs = [] def parse(self, fn): data = yaml.load(open(fn)) for item in data: cls, dfn = item.items()[0] group = self.data.get(cls, {}) if len(item.items()) > 1: n = None for k, v in item.items(): if k == "name": n = v break # Syntax error raise JenkinsJobsException("Syntax error, for item named " "'{0}'. Missing indent?".format(n)) name = dfn['name'] group[name] = dfn self.data[cls] = group def getJob(self, name): job = self.data.get('job', {}).get(name, None) if not job: return job return self.applyDefaults(job) def getJobGroup(self, name): return self.data.get('job-group', {}).get(name, None) def getJobTemplate(self, name): job = self.data.get('job-template', {}).get(name, None) if not job: return job return self.applyDefaults(job) def applyDefaults(self, data): whichdefaults = data.get('defaults', 'global') defaults = self.data.get('defaults', {}).get(whichdefaults, {}) newdata = {} newdata.update(defaults) newdata.update(data) return newdata def generateXML(self, jobs_filter=None): changed = True while changed: changed = False for module in self.registry.modules: if hasattr(module, 'handle_data'): if module.handle_data(self): changed = True for job in self.data.get('job', {}).values(): if jobs_filter and job not in jobs_filter: continue logger.debug("XMLifying job '{0}'".format(job['name'])) job = self.applyDefaults(job) self.getXMLForJob(job) for project in self.data.get('project', {}).values(): logger.debug("XMLifying project '{0}'".format(project['name'])) for jobspec in project.get('jobs', []): if isinstance(jobspec, dict): # Singleton dict containing dict of job-specific params jobname, jobparams = jobspec.items()[0] else: jobname = jobspec jobparams = {} job = self.getJob(jobname) if job: # Just naming an existing defined job continue # see if it's a job group group = self.getJobGroup(jobname) if group: for group_jobname in group['jobs']: job = self.getJob(group_jobname) if job: continue template = self.getJobTemplate(group_jobname) # Allow a group to override parameters set by a project d = {} d.update(project) d.update(jobparams) d.update(group) # Except name, since the group's name is not useful d['name'] = project['name'] if template: self.getXMLForTemplateJob(d, template, jobs_filter) continue # see if it's a template template = self.getJobTemplate(jobname) if template: d = {} d.update(project) d.update(jobparams) self.getXMLForTemplateJob(d, template, jobs_filter) def getXMLForTemplateJob(self, project, template, jobs_filter=None): dimensions = [] for (k, v) in project.items(): if type(v) == list and k not in ['jobs']: dimensions.append(zip([k] * len(v), v)) # XXX somewhat hackish to ensure we actually have a single # pass through the loop if len(dimensions) == 0: dimensions = [(("", ""),)] checksums = set([]) for values in itertools.product(*dimensions): params = copy.deepcopy(project) params.update(values) expanded = deep_format(template, params) # Keep track of the resulting expansions to avoid # regenerating the exact same job. Whenever a project has # different values for a parameter and that parameter is not # used in the template, we ended up regenerating the exact # same job. # To achieve that we serialize the expanded template making # sure the dict keys are always in the same order. Then we # record the checksum in an unordered unique set which let # us guarantee a group of parameters will not be added a # second time. uniq = json.dumps(expanded, sort_keys=True) checksum = hashlib.md5(uniq).hexdigest() # Lookup the checksum if checksum not in checksums: # We also want to skip XML generation whenever the user did # not ask for that job. job_name = expanded.get('name') if jobs_filter and job_name not in jobs_filter: continue logger.debug("Generating XML for template job {0}" " (params {1})".format( template['name'], params)) self.getXMLForJob(expanded) checksums.add(checksum) def getXMLForJob(self, data): kind = data.get('project-type', 'freestyle') for ep in pkg_resources.iter_entry_points( group='jenkins_jobs.projects', name=kind): Mod = ep.load() mod = Mod(self.registry) xml = mod.root_xml(data) self.gen_xml(xml, data) job = XmlJob(xml, data['name']) self.jobs.append(job) break def gen_xml(self, xml, data): for module in self.registry.modules: if hasattr(module, 'gen_xml'): module.gen_xml(self, xml, data) class ModuleRegistry(object): def __init__(self, config): self.modules = [] self.modules_by_component_type = {} self.handlers = {} self.global_config = config for entrypoint in pkg_resources.iter_entry_points( group='jenkins_jobs.modules'): Mod = entrypoint.load() mod = Mod(self) self.modules.append(mod) self.modules.sort(lambda a, b: cmp(a.sequence, b.sequence)) if mod.component_type is not None: self.modules_by_component_type[mod.component_type] = mod def registerHandler(self, category, name, method): cat_dict = self.handlers.get(category, {}) if not cat_dict: self.handlers[category] = cat_dict cat_dict[name] = method def getHandler(self, category, name): return self.handlers[category][name] def dispatch(self, component_type, parser, xml_parent, component, template_data={}): """This is a method that you can call from your implementation of Base.gen_xml or component. It allows modules to define a type of component, and benefit from extensibility via Python entry points and Jenkins Job Builder :ref:`Macros `. :arg string component_type: the name of the component (e.g., `builder`) :arg YAMLParser parser: the global YMAL Parser :arg Element xml_parent: the parent XML element :arg dict template_data: values that should be interpolated into the component definition See :py:class:`jenkins_jobs.modules.base.Base` for how to register components of a module. See the Publishers module for a simple example of how to use this method. """ if component_type not in self.modules_by_component_type: raise JenkinsJobsException("Unknown component type: " "'{0}'.".format(component_type)) component_list_type = self.modules_by_component_type[component_type] \ .component_list_type if isinstance(component, dict): # The component is a sigleton dictionary of name: dict(args) name, component_data = component.items()[0] if template_data: # Template data contains values that should be interpolated # into the component definition s = yaml.dump(component_data, default_flow_style=False) s = s.format(**template_data) component_data = yaml.load(s) else: # The component is a simple string name, eg "run-tests" name = component component_data = {} # Look for a component function defined in an entry point for ep in pkg_resources.iter_entry_points( group='jenkins_jobs.{0}'.format(component_list_type), name=name): func = ep.load() func(parser, xml_parent, component_data) else: # Otherwise, see if it's defined as a macro component = parser.data.get(component_type, {}).get(name) if component: for b in component[component_list_type]: # Pass component_data in as template data to this function # so that if the macro is invoked with arguments, # the arguments are interpolated into the real defn. self.dispatch(component_type, parser, xml_parent, b, component_data) class XmlJob(object): def __init__(self, xml, name): self.xml = xml self.name = name def md5(self): return hashlib.md5(self.output()).hexdigest() # Pretty printing ideas from # http://stackoverflow.com/questions/749796/pretty-printing-xml-in-python pretty_text_re = re.compile('>\n\s+([^<>\s].*?)\n\s+\g<1>= (2, 7): pass else: requirements.append(line) return requirements def parse_dependency_links(requirements_files=['requirements.txt', 'tools/pip-requires']): dependency_links = [] # dependency_links inject alternate locations to find packages listed # in requirements for line in get_reqs_from_files(requirements_files): # skip comments and blank lines if re.match(r'(\s*#)|(\s*$)', line): continue # lines with -e or -f need the whole line, minus the flag if re.match(r'\s*-[ef]\s+', line): dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line)) # lines that are only urls can go in unmolested elif re.match(r'\s*https?:', line): dependency_links.append(line) return dependency_links def write_requirements(): venv = os.environ.get('VIRTUAL_ENV', None) if venv is not None: with open("requirements.txt", "w") as req_file: output = subprocess.Popen(["pip", "-E", venv, "freeze", "-l"], stdout=subprocess.PIPE) requirements = output.communicate()[0].strip() req_file.write(requirements) def _run_shell_command(cmd): if os.name == 'nt': params = ["cmd", "/C"] else: params = ["/bin/sh", "-c"] params.append(cmd) output = subprocess.Popen(params, stdout=subprocess.PIPE) out = output.communicate() if len(out) == 0: return None if len(out[0].strip()) == 0: return None return out[0].strip() def _get_git_next_version_suffix(branch_name): datestamp = datetime.datetime.now().strftime('%Y%m%d') if branch_name == 'milestone-proposed': revno_prefix = "r" else: revno_prefix = "" _run_shell_command("git fetch origin +refs/meta/*:refs/remotes/meta/*") milestone_cmd = "git show meta/openstack/release:%s" % branch_name milestonever = _run_shell_command(milestone_cmd) if milestonever: first_half = "%s~%s" % (milestonever, datestamp) else: first_half = datestamp post_version = _get_git_post_version() # post version should look like: # 0.1.1.4.gcc9e28a # where the bit after the last . is the short sha, and the bit between # the last and second to last is the revno count (revno, sha) = post_version.split(".")[-2:] second_half = "%s%s.%s" % (revno_prefix, revno, sha) return ".".join((first_half, second_half)) def _get_git_current_tag(): return _run_shell_command("git tag --contains HEAD") def _get_git_tag_info(): return _run_shell_command("git describe --tags") def _get_git_post_version(): current_tag = _get_git_current_tag() if current_tag is not None: return current_tag else: tag_info = _get_git_tag_info() if tag_info is None: base_version = "0.0" cmd = "git --no-pager log --oneline" out = _run_shell_command(cmd) revno = len(out.split("\n")) sha = _run_shell_command("git describe --always") else: tag_infos = tag_info.split("-") base_version = "-".join(tag_infos[:-2]) (revno, sha) = tag_infos[-2:] return "%s.%s.%s" % (base_version, revno, sha) def write_git_changelog(): """Write a changelog based on the git changelog.""" new_changelog = 'ChangeLog' if not os.getenv('SKIP_WRITE_GIT_CHANGELOG'): if os.path.isdir('.git'): git_log_cmd = 'git log --stat' changelog = _run_shell_command(git_log_cmd) mailmap = parse_mailmap() with open(new_changelog, "w") as changelog_file: changelog_file.write(canonicalize_emails(changelog, mailmap)) else: open(new_changelog, 'w').close() def generate_authors(): """Create AUTHORS file using git commits.""" jenkins_email = 'jenkins@review.(openstack|stackforge).org' old_authors = 'AUTHORS.in' new_authors = 'AUTHORS' if not os.getenv('SKIP_GENERATE_AUTHORS'): if os.path.isdir('.git'): # don't include jenkins email address in AUTHORS file git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | " "egrep -v '" + jenkins_email + "'") changelog = _run_shell_command(git_log_cmd) mailmap = parse_mailmap() with open(new_authors, 'w') as new_authors_fh: new_authors_fh.write(canonicalize_emails(changelog, mailmap)) if os.path.exists(old_authors): with open(old_authors, "r") as old_authors_fh: new_authors_fh.write('\n' + old_authors_fh.read()) else: open(new_authors, 'w').close() _rst_template = """%(heading)s %(underline)s .. automodule:: %(module)s :members: :undoc-members: :show-inheritance: """ def read_versioninfo(project): """Read the versioninfo file. If it doesn't exist, we're in a github zipball, and there's really no way to know what version we really are, but that should be ok, because the utility of that should be just about nil if this code path is in use in the first place.""" versioninfo_path = os.path.join(project, 'versioninfo') if os.path.exists(versioninfo_path): with open(versioninfo_path, 'r') as vinfo: version = vinfo.read().strip() else: version = "0.0.0" return version def write_versioninfo(project, version): """Write a simple file containing the version of the package.""" with open(os.path.join(project, 'versioninfo'), 'w') as fil: fil.write("%s\n" % version) def get_cmdclass(): """Return dict of commands to run from setup.py.""" cmdclass = dict() def _find_modules(arg, dirname, files): for filename in files: if filename.endswith('.py') and filename != '__init__.py': arg["%s.%s" % (dirname.replace('/', '.'), filename[:-3])] = True class LocalSDist(sdist.sdist): """Builds the ChangeLog and Authors files from VC first.""" def run(self): write_git_changelog() generate_authors() # sdist.sdist is an old style class, can't use super() sdist.sdist.run(self) cmdclass['sdist'] = LocalSDist # If Sphinx is installed on the box running setup.py, # enable setup.py to build the documentation, otherwise, # just ignore it try: from sphinx.setup_command import BuildDoc class LocalBuildDoc(BuildDoc): def generate_autoindex(self): print "**Autodocumenting from %s" % os.path.abspath(os.curdir) modules = {} option_dict = self.distribution.get_option_dict('build_sphinx') source_dir = os.path.join(option_dict['source_dir'][1], 'api') if not os.path.exists(source_dir): os.makedirs(source_dir) for pkg in self.distribution.packages: if '.' not in pkg: os.path.walk(pkg, _find_modules, modules) module_list = modules.keys() module_list.sort() autoindex_filename = os.path.join(source_dir, 'autoindex.rst') with open(autoindex_filename, 'w') as autoindex: autoindex.write(""".. toctree:: :maxdepth: 1 """) for module in module_list: output_filename = os.path.join(source_dir, "%s.rst" % module) heading = "The :mod:`%s` Module" % module underline = "=" * len(heading) values = dict(module=module, heading=heading, underline=underline) print "Generating %s" % output_filename with open(output_filename, 'w') as output_file: output_file.write(_rst_template % values) autoindex.write(" %s.rst\n" % module) def run(self): if not os.getenv('SPHINX_DEBUG'): self.generate_autoindex() for builder in ['html', 'man']: self.builder = builder self.finalize_options() self.project = self.distribution.get_name() self.version = self.distribution.get_version() self.release = self.distribution.get_version() BuildDoc.run(self) cmdclass['build_sphinx'] = LocalBuildDoc except ImportError: pass return cmdclass def get_git_branchname(): for branch in _run_shell_command("git branch --color=never").split("\n"): if branch.startswith('*'): _branch_name = branch.split()[1].strip() if _branch_name == "(no": _branch_name = "no-branch" return _branch_name def get_pre_version(projectname, base_version): """Return a version which is leading up to a version that will be released in the future.""" if os.path.isdir('.git'): current_tag = _get_git_current_tag() if current_tag is not None: version = current_tag else: branch_name = os.getenv('BRANCHNAME', os.getenv('GERRIT_REFNAME', get_git_branchname())) version_suffix = _get_git_next_version_suffix(branch_name) version = "%s~%s" % (base_version, version_suffix) write_versioninfo(projectname, version) return version else: version = read_versioninfo(projectname) return version def get_post_version(projectname): """Return a version which is equal to the tag that's on the current revision if there is one, or tag plus number of additional revisions if the current revision has no tag.""" if os.path.isdir('.git'): version = _get_git_post_version() write_versioninfo(projectname, version) return version return read_versioninfo(projectname) jenkins-job-builder-0.5.0/jenkins_jobs/openstack/common/__init__.py0000664000175300017540000000000012160635010026534 0ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/openstack/common/version.py0000664000175300017540000001337512160635010026505 0ustar jenkinsjenkins00000000000000# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # 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. """ Utilities for consuming the auto-generated versioninfo files. """ import datetime import pkg_resources import setup class _deferred_version_string(object): """Internal helper class which provides delayed version calculation.""" def __init__(self, version_info, prefix): self.version_info = version_info self.prefix = prefix def __str__(self): return "%s%s" % (self.prefix, self.version_info.version_string()) def __repr__(self): return "%s%s" % (self.prefix, self.version_info.version_string()) class VersionInfo(object): def __init__(self, package, python_package=None, pre_version=None): """Object that understands versioning for a package :param package: name of the top level python namespace. For glance, this would be "glance" for python-glanceclient, it would be "glanceclient" :param python_package: optional name of the project name. For glance this can be left unset. For python-glanceclient, this would be "python-glanceclient" :param pre_version: optional version that the project is working to """ self.package = package if python_package is None: self.python_package = package else: self.python_package = python_package self.pre_version = pre_version self.version = None def _generate_version(self): """Defer to the openstack.common.setup routines for making a version from git.""" if self.pre_version is None: return setup.get_post_version(self.python_package) else: return setup.get_pre_version(self.python_package, self.pre_version) def _newer_version(self, pending_version): """Check to see if we're working with a stale version or not. We expect a version string that either looks like: 2012.2~f3~20120708.10.4426392 which is an unreleased version of a pre-version, or: 0.1.1.4.gcc9e28a which is an unreleased version of a post-version, or: 0.1.1 Which is a release and which should match tag. For now, if we have a date-embedded version, check to see if it's old, and if so re-generate. Otherwise, just deal with it. """ try: version_date = int(self.version.split("~")[-1].split('.')[0]) if version_date < int(datetime.date.today().strftime('%Y%m%d')): return self._generate_version() else: return pending_version except Exception: return pending_version def version_string_with_vcs(self, always=False): """Return the full version of the package including suffixes indicating VCS status. For instance, if we are working towards the 2012.2 release, canonical_version_string should return 2012.2 if this is a final release, or else something like 2012.2~f1~20120705.20 if it's not. :param always: if true, skip all version caching """ if always: self.version = self._generate_version() if self.version is None: requirement = pkg_resources.Requirement.parse(self.python_package) versioninfo = "%s/versioninfo" % self.package try: raw_version = pkg_resources.resource_string(requirement, versioninfo) self.version = self._newer_version(raw_version.strip()) except (IOError, pkg_resources.DistributionNotFound): self.version = self._generate_version() return self.version def canonical_version_string(self, always=False): """Return the simple version of the package excluding any suffixes. For instance, if we are working towards the 2012.2 release, canonical_version_string should return 2012.2 in all cases. :param always: if true, skip all version caching """ return self.version_string_with_vcs(always).split('~')[0] def version_string(self, always=False): """Return the base version of the package. For instance, if we are working towards the 2012.2 release, version_string should return 2012.2 if this is a final release, or 2012.2-dev if it is not. :param always: if true, skip all version caching """ version_parts = self.version_string_with_vcs(always).split('~') if len(version_parts) == 1: return version_parts[0] else: return '%s-dev' % (version_parts[0],) def deferred_version_string(self, prefix=""): """Generate an object which will expand in a string context to the results of version_string(). We do this so that don't call into pkg_resources every time we start up a program when passing version information into the CONF constructor, but rather only do the calculation when and if a version is requested """ return _deferred_version_string(self, prefix) jenkins-job-builder-0.5.0/jenkins_jobs/openstack/__init__.py0000664000175300017540000000000012160635010025244 0ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/jenkins_jobs/cmd.py0000775000175300017540000001034212160635010022276 0ustar jenkinsjenkins00000000000000#!/usr/bin/env python # Copyright (C) 2012 OpenStack Foundation # # 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 argparse import ConfigParser import logging import os import sys def confirm(question): answer = raw_input('%s (Y/N): ' % question).upper().strip() if not answer == 'Y': sys.exit('Aborted') def main(): import jenkins_jobs.builder import jenkins_jobs.errors parser = argparse.ArgumentParser() subparser = parser.add_subparsers(help='update, test or delete job', dest='command') parser_update = subparser.add_parser('update') parser_update.add_argument('path', help='Path to YAML file or directory') parser_update.add_argument('names', help='name(s) of job(s)', nargs='*') parser_test = subparser.add_parser('test') parser_test.add_argument('path', help='Path to YAML file or directory') parser_test.add_argument('-o', dest='output_dir', help='Path to output XML') parser_test.add_argument('name', help='name(s) of job(s)', nargs='*') parser_delete = subparser.add_parser('delete') parser_delete.add_argument('name', help='name of job', nargs='+') subparser.add_parser('delete-all', help='Delete *ALL* jobs from Jenkins server, ' 'including those not managed by Jenkins Job ' 'Builder.') parser.add_argument('--conf', dest='conf', help='Configuration file') parser.add_argument('-l', '--log_level', dest='log_level', default='info', help="Log level (default: %(default)s)") options = parser.parse_args() options.log_level = getattr(logging, options.log_level.upper(), logging.INFO) logging.basicConfig(level=options.log_level) logger = logging.getLogger() conf = '/etc/jenkins_jobs/jenkins_jobs.ini' if options.conf: conf = options.conf else: # Fallback to script directory localconf = os.path.join(os.path.dirname(__file__), 'jenkins_jobs.ini') if os.path.isfile(localconf): conf = localconf if os.path.isfile(conf): logger.debug("Reading config from {0}".format(conf)) conffp = open(conf, 'r') config = ConfigParser.ConfigParser() config.readfp(conffp) elif options.command == 'test': logger.debug("Not reading config for test output generation") config = {} else: raise jenkins_jobs.errors.JenkinsJobsException( "A valid configuration file is required when not run as a test") logger.debug("Config: {0}".format(config)) builder = jenkins_jobs.builder.Builder(config.get('jenkins', 'url'), config.get('jenkins', 'user'), config.get('jenkins', 'password'), config) if options.command == 'delete': for job in options.name: logger.info("Deleting job {0}".format(job)) builder.delete_job(job) elif options.command == 'delete-all': confirm('Sure you want to delete *ALL* jobs from Jenkins server?\n' '(including those not managed by Jenkins Job Builder)') logger.info("Deleting all jobs") builder.delete_all_jobs() elif options.command == 'update': logger.info("Updating jobs in {0} ({1})".format( options.path, options.names)) builder.update_job(options.path, options.names) elif options.command == 'test': builder.update_job(options.path, options.name, output_dir=options.output_dir) if __name__ == '__main__': sys.path.insert(0, '.') main() jenkins-job-builder-0.5.0/tools/0000775000175300017540000000000012160635107017647 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/tools/test-requires0000664000175300017540000000003312160635010022373 0ustar jenkinsjenkins00000000000000sphinx setuptools_git>=0.4 jenkins-job-builder-0.5.0/tools/test.sh0000775000175300017540000000212412160635010021155 0ustar jenkinsjenkins00000000000000#!/bin/bash # A simple script to verify that the XML output is unaltered after a change. # First, symlink "config" to the directory containing your config files # (eg openstack-infra/config/modules/openstack_project/files/jenkins_job_builder/config) # Before you start work, run "./test.sh save". # As you test your change, run "./test.sh" to see differences in XML output. mkdir -p /tmp/jenkins_jobs_test/saved mkdir -p /tmp/jenkins_jobs_test/test if [ "$1" == "save" ] then rm -f /tmp/jenkins_jobs_test/saved/* jenkins-jobs test -o /tmp/jenkins_jobs_test/saved/ config else rm -f /tmp/jenkins_jobs_test/test/* jenkins-jobs test -o /tmp/jenkins_jobs_test/test/ config for x in `(cd /tmp/jenkins_jobs_test/saved && find -type f)` do if ! diff -u /tmp/jenkins_jobs_test/saved/$x /tmp/jenkins_jobs_test/test/$x >/dev/null 2>&1 then echo "============================================================" echo $x echo "------------------------------------------------------------" fi diff -u /tmp/jenkins_jobs_test/saved/$x /tmp/jenkins_jobs_test/test/$x done fi jenkins-job-builder-0.5.0/tools/pip-requires0000664000175300017540000000002612160635010022206 0ustar jenkinsjenkins00000000000000PyYAML python-jenkins jenkins-job-builder-0.5.0/tools/run-compare-xml-samples.sh0000775000175300017540000000350012160635010024665 0ustar jenkinsjenkins00000000000000#!/bin/bash -e # Copied and modified from tools/run-compare-xml.sh # Copyright (c) 2012, AT&T Labs, Yun Mao # All Rights Reserved. # Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. # Assuming that all samples can be sensibly run at the same time. rm -fr .test mkdir -p .test/old/config mkdir -p .test/old/out mkdir -p .test/new/config mkdir -p .test/new/out cp samples/*.yaml .test/old/config cp .test/old/config/* .test/new/config GITHEAD=`git rev-parse HEAD` # First generate output from HEAD~1 git checkout HEAD~1 tox -e compare-xml-old # Then use that as a reference to compare against HEAD git checkout $GITHEAD tox -e compare-xml-new CHANGED=0 for x in `(cd .test/old/out && find -type f)` do if ! diff -u .test/old/out/$x .test/new/out/$x >/dev/null 2>&1 then CHANGED=1 echo "============================================================" echo $x echo "------------------------------------------------------------" fi diff -u .test/old/out/$x .test/new/out/$x || /bin/true done echo echo "You are in detached HEAD mode. If you are a developer" echo "and not very familiar with git, you might want to do" echo "'git checkout branch-name' to go back to your branch." if [ "$CHANGED" -eq "1" ]; then exit 1 fi exit 0 jenkins-job-builder-0.5.0/tools/run-compare-xml.sh0000775000175300017540000000357212160635010023234 0ustar jenkinsjenkins00000000000000#!/bin/bash -e # Copyright (c) 2012, AT&T Labs, Yun Mao # All Rights Reserved. # Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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. rm -fr .test mkdir -p .test/old/config mkdir -p .test/old/out mkdir -p .test/new/config mkdir -p .test/new/out cd .test git clone https://review.openstack.org/p/openstack-infra/config --depth 1 cp config/modules/openstack_project/files/jenkins_job_builder/config/* old/config cp config/modules/openstack_project/files/jenkins_job_builder/config/* new/config cd .. GITHEAD=`git rev-parse HEAD` # First generate output from HEAD~1 git checkout HEAD~1 tox -e compare-xml-old # Then use that as a reference to compare against HEAD git checkout $GITHEAD tox -e compare-xml-new CHANGED=0 for x in `(cd .test/old/out && find -type f)` do if ! diff -u .test/old/out/$x .test/new/out/$x >/dev/null 2>&1 then CHANGED=1 echo "============================================================" echo $x echo "------------------------------------------------------------" fi diff -u .test/old/out/$x .test/new/out/$x || /bin/true done echo echo "You are in detached HEAD mode. If you are a developer" echo "and not very familiar with git, you might want to do" echo "'git checkout branch-name' to go back to your branch." if [ "$CHANGED" -eq "1" ]; then exit 1 fi exit 0 jenkins-job-builder-0.5.0/tools/jenkins-jobs.py0000775000175300017540000000151112160635010022607 0ustar jenkinsjenkins00000000000000#!/usr/bin/env python # Copyright (C) 2013 OpenStack Foundation # # 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. # A simple test script to invoke the command entry point from the # source directory without the necessity of installation. import os import sys sys.path.append(os.path.abspath('.')) import jenkins_jobs.cmd jenkins_jobs.cmd.main() jenkins-job-builder-0.5.0/AUTHORS0000664000175300017540000000220612160635106017556 0ustar jenkinsjenkins00000000000000Andrew Hutchings Antoine Musso Arnaud Fabre Attila Fazekas Clark Boylan desbonne Doug Hellmann Eric Erfanian Ghe Rivero James E. Blair James E. Blair Javier Martinez Canillas Jeremy Stanley Jon-Paul Sullivan Julian Taylor Julien Danjou Kiall Mac Innes K Jonathan Harker Lukas Bednar Manuel Desbonnet Mark Holmquist Mathieu Gagné Monty Taylor Paul Belanger Timo Tijhof Tollef Fog Heen Tollef Fog Heen unicell william.soula Will Soula jenkins-job-builder-0.5.0/MANIFEST.in0000664000175300017540000000020012160635010020226 0ustar jenkinsjenkins00000000000000include jenkins_jobs/versioninfo include AUTHORS include ChangeLog exclude .gitignore exclude .gitreview global-exclude *.pyc jenkins-job-builder-0.5.0/doc/0000775000175300017540000000000012160635107017254 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/doc/source/0000775000175300017540000000000012160635107020554 5ustar jenkinsjenkins00000000000000jenkins-job-builder-0.5.0/doc/source/conf.py0000664000175300017540000001775012160635010022056 0ustar jenkinsjenkins00000000000000# -*- coding: utf-8 -*- # # Jenkins Job Builder documentation build configuration file, created by # sphinx-quickstart on Mon Sep 10 19:36:21 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('../../jenkins_jobs/modules')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage', 'jenkins_jobs.sphinx.yaml'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Jenkins Job Builder' copyright = u'2012, Jenkins Job Builder Maintainers' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # Version info from jenkins_jobs.version import version_info as jenkins_jobs_version release = jenkins_jobs_version.version_string_with_vcs() # The short X.Y version. version = jenkins_jobs_version.canonical_version_string() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'JenkinsJobBuilderdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'JenkinsJobBuilder.tex', u'Jenkins Job Builder Documentation', u'Jenkins Job Builder Maintainers', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'jenkins-jobs', u'Jenkins Job Builder Documentation', [u'Jenkins Job Builder Maintainers'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'JenkinsJobBuilder', u'Jenkins Job Builder Documentation', u'Jenkins Job Builder Maintainers', 'JenkinsJobBuilder', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' jenkins-job-builder-0.5.0/doc/source/project_freestyle.rst0000664000175300017540000000015412160635010025027 0ustar jenkinsjenkins00000000000000.. _project_freestyle: Freestyle Project ================= .. automodule:: project_freestyle :members: jenkins-job-builder-0.5.0/doc/source/builders.rst0000664000175300017540000000011012160635010023100 0ustar jenkinsjenkins00000000000000.. _builders: Builders ======== .. automodule:: builders :members: jenkins-job-builder-0.5.0/doc/source/configuration.rst0000664000175300017540000002162312160635010024152 0ustar jenkinsjenkins00000000000000Configuration ============= The job definitions for Jenkins Job Builder are kept in any number of YAML files, in whatever way you would like to organize them. When you invoke ``jenkins-jobs`` you may specify either the path of a single YAML file, or a directory. If you choose a directory, all of the .yaml (or .yml) files in that directory will be read, and all the jobs they define will be created or updated. Definitions ----------- Jenkins Job Builder understands a few basic object types which are described in the next sections. .. _job: Job ^^^ The most straightforward way to create a job is simply to define a Job in YAML. It looks like this:: - job: name: job-name That's not very useful, so you'll want to add some actions such as :ref:`builders`, and perhaps :ref:`publishers`. Those are described later. There are a few basic optional fields for a Job definition:: - job: name: job-name project-type: freestyle defaults: global disabled: false concurrent: true quiet-period: 5 workspace: /srv/build-area/job-name block-downstream: false block-upstream: false **project-type** Defaults to "freestyle", but "maven" can also be specified. **defaults** Specifies a set of `Defaults`_ to use for this job, defaults to ''global''. If you have values that are common to all of your jobs, create a ``global`` `Defaults`_ object to hold them, and no further configuration of individual jobs is necessary. If some jobs should not use the ``global`` defaults, use this field to specify a different set of defaults. **disabled** Boolean value to set whether or not this job should be disabled in Jenkins. Defaults to ``false`` (job will be enabled). **concurrent** Boolean value to set whether or not Jenkins can run this job concurrently. Defaults to ``false``. **quiet-period** Number of seconds to wait between consecutive runs of this job. Defaults to ``0``. **workspace** Path for a 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 transitively. Defaults to ``false``. **block-upstream** Boolean value to set whether or not this job must block while upstream jobs are running. Upstream jobs are determined transitively. Defaults to ``false``. **auth-token** Specifies an authentication token that allows new builds to be triggered by accessing a special predefined URL. Only those who know the token will be able to trigger builds remotely. .. _job-template: Job Template ^^^^^^^^^^^^ If you need several jobs defined that are nearly identical, except perhaps in their names, SCP targets, etc., then you may use a Job Template to specify the particulars of the job, and then use a `Project`_ to realize the job with appropriate variable substitution. A Job Template has the same syntax as a `Job`_, but you may add variables anywhere in the definition. Variables are indicated by enclosing them in braces, e.g., ``{name}`` will substitute the variable `name`. When using a variable in a string field, it is good practice to wrap the entire string in quotes, even if the rules of YAML syntax don't require it because the value of the variable may require quotes after substitution. You must include a variable in the ``name`` field of a Job Template (otherwise, every instance would have the same name). For example:: - job-template: name: '{name}-unit-tests' Will not cause any job to be created in Jenkins, however, it will define a template that you can use to create jobs with a `Project`_ definition. It's name will depend on what is supplied to the `Project`_. .. _project: Project ^^^^^^^ The purpose of a project is to collect related jobs together, and provide values for the variables in a `Job Template`_. It looks like this:: - project: name: project-name jobs: - '{name}-unit-tests' Any number of arbitrarily named additional fields may be specified, and they will be available for variable substitution in the job template. Any job templates listed under ``jobs:`` will be realized with those values. The example above would create the job called 'project-name-unit-tests' in Jenkins. The ``jobs:`` list can also allow for specifying job-specific substitutions as follows:: - project: name: project-name jobs: - '{name}-unit-tests': mail-to: developer@nowhere.net - '{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 values. Example:: - project: name: project-name pyver: - 26 - 27 jobs: - '{name}-{pyver}' Job Group ^^^^^^^^^ 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:: - job-template: name: '{name}-python-26' - 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 in Jekins. .. _macro: Macro ^^^^^ Many of the actions of a `Job`_, such as builders or publishers, can be defined as a Macro, and then that Macro used in the `Job`_ description. Builders are described later, but let's introduce a simple one now to illustrate the Macro functionality. This snippet will instruct Jenkins to execute "make test" as part of the job:: - job: name: foo-test builders: - shell: 'make test' If you wanted to define a macro (which won't save much typing in this case, but could still be useful to centralize the definition of a commonly repeated task), the configuration would look like:: - builder: name: make-test builders: - shell: 'make test' - job: name: foo-test builders: - make-test This allows you to create complex actions (and even sequences of actions) in YAML that look like first-class Jenkins Job Builder actions. Not every attribute supports Macros, check the documentation for the action before you try to use a Macro for it. Macros can take parameters, letting you define a generic macro and more specific ones without having to duplicate code:: # The 'add' macro takes a 'number' parameter and will creates a # job which prints 'Adding ' followed by the 'number' parameter: - builder: name: add builders: - shell: "echo Adding {number}" # A specialized macro 'addtwo' reusing the 'add' macro but with # a 'number' parameter hardcoded to 'two': - builder: name: addtwo builders: - add: number: "two" # Glue to have Jenkins Job Builder to expand this YAML example: - job: name: "testingjob" builders: # The specialized macro: - addtwo # Generic macro call with a parameter - add: number: "ZERO" # Generic macro called without a parameter. Never do this! # See below for the resulting wrong output :( - add Then ```` section of the generated job show up as:: echo Adding two echo Adding ZERO echo Adding {number} As you can see, the specialized macro ``addtwo`` reused the definition from the generic macro ``add``. Whenever you forget a parameter from a macro, it will not be expanded and left as is, which will most probably cause havoc in your Jenkins builds. .. _defaults: Defaults ^^^^^^^^ Defaults collect job attributes (including actions) and will supply those values when the job is created, unless superseded by a value in the 'Job'_ definition. If a set of Defaults is specified with the name ``global``, that will be used by all `Job`_ (and `Job Template`_) definitions unless they specify a different Default object with the ``defaults`` attribute. For example:: - defaults: name: global description: 'Do not edit this job through the web!' Will set the job description for every job created. Modules ------- The bulk of the job definitions come from the following modules. .. toctree:: :maxdepth: 2 project_freestyle project_maven project_matrix general builders hipchat notifications parameters properties publishers reporters scm triggers wrappers zuul jenkins-job-builder-0.5.0/doc/source/triggers.rst0000664000175300017540000000011012160635010023115 0ustar jenkinsjenkins00000000000000.. _triggers: Triggers ======== .. automodule:: triggers :members: jenkins-job-builder-0.5.0/doc/source/extending.rst0000664000175300017540000000520412160635010023265 0ustar jenkinsjenkins00000000000000.. _extending: Extending ========= Jenkins Job Builder is quite modular. It is easy to add new attributes to existing components, a new module to support a Jenkins plugin, or include locally defined methods to deal with an idiosyncratic build system. XML Processing -------------- Most of the work of building XML from the YAML configuration file is handled by individual functions that implement a single characteristic. For example, see the ``jenkins_jobs/modules/builders.py`` file for the Python module that implements the standard Jenkins builders. The ``shell`` function at the top of the file implements the standard `Execute a shell` build step. All of the YAML to XML functions in Jenkins Job Builder have the same signature: .. _component_interface: .. py:function:: component(parser, xml_parent, data) :noindex: :arg YAMLParser parser: the jenkins jobs YAML parser :arg Element xml_parent: this attribute's parent XML element :arg dict data: the YAML data structure for this attribute and below The function is expected to examine the YAML data structure and create new XML nodes and attach them to the xml_parent element. This general pattern is applied throughout the included modules. .. _module: Modules ------- Nearly all of Jenkins Job Builder is implemented in modules. The main program has no concept of builders, publishers, properties, or any other aspects of job definition. Each of those building blocks is defined in a module, and due to the use of setuptools entry points, most modules are easily extensible with new components. To add a new module, define a class that inherits from :py:class:`jenkins_jobs.modules.base.Base`, and add it to the ``jenkins_jobs.modules`` entry point in your setup.py. .. autoclass:: jenkins_jobs.modules.base.Base :members: :undoc-members: :private-members: .. _component: Components ---------- Most of the standard modules supply a number of components, and it's easy to provide your own components for use by those modules. For instance, the Builders module provides several builders, such as the `shell` builder as well as the `trigger_builds` builder. If you wanted to add a new builder, all you need to do is write a function that conforms to the :ref:`Component Interface `, and then add that function to the appropriate entry point (via a setup.py file). .. _module_registry: Module Registry --------------- All modules and their associated components are registered in the module registry. It can be accessed either from modules via the registry field, or via the parser parameter of components. .. autoclass:: jenkins_jobs.builder.ModuleRegistry :members: jenkins-job-builder-0.5.0/doc/source/hipchat.rst0000664000175300017540000000011512160635010022714 0ustar jenkinsjenkins00000000000000.. _hipchat: Hipchat ========== .. automodule:: hipchat_notif :members: jenkins-job-builder-0.5.0/doc/source/installation.rst0000664000175300017540000000512512160635010024003 0ustar jenkinsjenkins00000000000000Installation ============ To install Jenkins Job Builder, run:: sudo python setup.py install The OpenStack project uses puppet to manage its infrastructure 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 Configuration File ------------------ After installation, you will need to create a configuration file. By default, `jenkins-jobs` looks in ``/etc/jenkins_jobs/jenkins_jobs.ini`` but you may specify an alternate location when running `jenkins-jobs`. The file should have the following format:: [jenkins] user=USERNAME password=PASSWORD url=JENKINS_URL **user** This should be the name of a user previously defined in Jenkins. Appropriate user permissions must be set under the Jenkins security matrix: under the ``Global`` group of permissions, check ``Read``, then under the ``Job`` group of permissions, check ``Create``, ``Delete``, ``Configure`` and finally ``Read``. **password** The API token for the user specified. You can get this through the Jenkins management interface under ``People`` -> username -> ``Configure`` and then click the ``Show API Token`` button. **url** The base URL for your Jenkins installation. Running ------- After it's installed and configured, you can invoke Jenkins Job Builder by running ``jenkins-jobs``. You won't be able to do anything useful just yet without a configuration which is discussed in the next section). But you should be able to get help on the various commands by running:: jenkins-jobs --help jenkins-jobs update --help jenkins-jobs test --help (etc.) Once you have a configuration defined, you can test it with:: jenkins-jobs test /path/to/config -o /path/to/output That will write XML files to the output directory for all of the jobs defined in the configuration directory. When you're satisfied, you can run:: jenkins-jobs update /path/to/config Which will upload the configurations to Jenkins if needed. Jenkins Job Builder maintains, for each host, a cache of previously configured jobs, so that you can run that command as often as you like, and it will only update the configuration in Jenkins if the defined configuration has changed since the last time it was run. Note: if you modify a job directly in Jenkins, jenkins-jobs will not know about it and will not update it. To update a specific list of jobs, simply pass them as additional arguments after the configuration path. To update Foo1 and Foo2 run:: jenkins-jobs update /path/to/config Foo1 Foo2 jenkins-job-builder-0.5.0/doc/source/properties.rst0000664000175300017540000000012012160635010023464 0ustar jenkinsjenkins00000000000000.. _properties: Properties ========== .. automodule:: properties :members: jenkins-job-builder-0.5.0/doc/source/index.rst0000664000175300017540000000153512160635010022412 0ustar jenkinsjenkins00000000000000.. Jenkins Job Builder documentation master file, created by sphinx-quickstart on Mon Sep 10 19:36:21 2012. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. 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. .. _Jenkins: http://jenkins-ci.org/ .. _YAML: http://www.yaml.org/ Contents: .. toctree:: :maxdepth: 3 installation configuration extending Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` jenkins-job-builder-0.5.0/doc/source/zuul.rst0000664000175300017540000000007412160635010022277 0ustar jenkinsjenkins00000000000000.. _zuul_doc: Zuul ==== .. automodule:: zuul :members: jenkins-job-builder-0.5.0/doc/source/reporters.rst0000664000175300017540000000011412160635010023320 0ustar jenkinsjenkins00000000000000.. _reporters: Reporters ========= .. automodule:: reporters :members: jenkins-job-builder-0.5.0/doc/source/notifications.rst0000664000175300017540000000013412160635010024146 0ustar jenkinsjenkins00000000000000.. _notifications: Notifications ============= .. automodule:: notifications :members: jenkins-job-builder-0.5.0/doc/source/project_matrix.rst0000664000175300017540000000014012160635010024324 0ustar jenkinsjenkins00000000000000.. _project_matrix: Matrix Project ============== .. automodule:: project_matrix :members: jenkins-job-builder-0.5.0/doc/source/general.rst0000664000175300017540000000450012160635010022713 0ustar jenkinsjenkins00000000000000.. _general: General Job Configuration ========================= The most straightforward way to create a job is simply to define a Job in YAML. It looks like this:: - job: name: job-name That's not very useful, so you'll want to add some actions such as :ref:`builders`, and perhaps :ref:`publishers`. Those are described later. There are a few basic optional fields for a Job definition:: - job: name: job-name project-type: freestyle defaults: global disabled: false concurrent: true workspace: /srv/build-area/job-name quiet-period: 5 block-downstream: false block-upstream: false :Job Parameters: * **project-type**: Defaults to "freestyle", but "maven" can also be specified. * **defaults**: Specifies a set of :ref:`defaults` to use for this job, defaults to ''global''. If you have values that are common to all of your jobs, create a ``global`` :ref:`defaults` object to hold them, and no further configuration of individual jobs is necessary. If some jobs should not use the ``global`` defaults, use this field to specify a different set of defaults. * **disabled**: Boolean value to set whether or not this job should be disabled in Jenkins. Defaults to ``false`` (job will be enabled). * **concurrent**: Boolean value to set whether or not Jenkins can run this job concurrently. Defaults to ``false``. * **workspace**: Path for a custom workspace. Defaults to Jenkins default configuration. * **quiet-period**: Number of seconds to wait between consecutive runs of this job. Defaults to ``0``. * **block-downstream**: Boolean value to set whether or not this job must block while downstream jobs are running. Downstream jobs are determined transitively. Defaults to ``false``. * **block-upstream**: Boolean value to set whether or not this job must block while upstream jobs are running. Upstream jobs are determined transitively. Defaults to ``false``. * **auth-token**: Specifies an authentication token that allows new builds to be triggered by accessing a special predefined URL. Only those who know the token will be able to trigger builds remotely. .. automodule:: general :members: jenkins-job-builder-0.5.0/doc/source/parameters.rst0000664000175300017540000000012012160635010023433 0ustar jenkinsjenkins00000000000000.. _parameters: Parameters ========== .. automodule:: parameters :members: jenkins-job-builder-0.5.0/doc/source/publishers.rst0000664000175300017540000000012012160635010023450 0ustar jenkinsjenkins00000000000000.. _publishers: Publishers ========== .. automodule:: publishers :members: jenkins-job-builder-0.5.0/doc/source/wrappers.rst0000664000175300017540000000011012160635010023132 0ustar jenkinsjenkins00000000000000.. _wrappers: Wrappers ======== .. automodule:: wrappers :members: jenkins-job-builder-0.5.0/doc/source/project_maven.rst0000664000175300017540000000013412160635010024131 0ustar jenkinsjenkins00000000000000.. _project_maven: Maven Project ============= .. automodule:: project_maven :members: jenkins-job-builder-0.5.0/doc/source/scm.rst0000664000175300017540000000006412160635010022061 0ustar jenkinsjenkins00000000000000.. _scm: SCM === .. automodule:: scm :members: jenkins-job-builder-0.5.0/doc/Makefile0000664000175300017540000001276412160635010020717 0ustar jenkinsjenkins00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = -W SPHINXBUILD = sphinx-build PAPER = BUILDDIR = build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/JenkinsJobBuilder.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/JenkinsJobBuilder.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/JenkinsJobBuilder" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/JenkinsJobBuilder" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." jenkins-job-builder-0.5.0/LICENSE0000664000175300017540000002613612160635010017515 0ustar jenkinsjenkins00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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. jenkins-job-builder-0.5.0/ChangeLog0000664000175300017540000074404712160635106020300 0ustar jenkinsjenkins00000000000000commit 8e6b9e900d1fb2db987888c23394bab6b350c5fc Author: Arnaud Fabre Date: Tue Jun 18 01:24:08 2013 +0200 setup.py: Basic support for windows. During setup, some commands (git describe mainly) are launched, and fail under Windows since /bin/sh is not available. By switching to cmd to execute commands when python says that the os is 'nt', setup.py works under both Linux and Windows. I have used that patch for some time now, and haven't found other issues yet. Change-Id: Ib4c0ec53765ae80fc6b63c34a926644427a9ebce Reviewed-on: https://review.openstack.org/33368 Reviewed-by: Antoine Musso Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Reviewed-by: Monty Taylor Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/openstack/common/setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 79d7d5e64bd59f638a88a8b6eafc6f429da62ff8 Author: Arnaud Fabre Date: Tue Jun 18 21:39:01 2013 +0200 Maven: expose configuration of automatic archiving. By default, Maven projects are configured to automatically archive maven artifacts. This commit exposes an option to configure that behavior in a backward compatible way. By default, automatic archiving is active, which means writing false in the XML configuration, since the element name is "archivingDisabled". Change-Id: I35e8a035a53356d7c171735aa5a52c6c429d1608 Reviewed-on: https://review.openstack.org/33367 Reviewed-by: Antoine Musso Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/project_maven.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 47c9076be2cb1bbb30b9568359aa8f0d29957e96 Author: Arnaud Fabre Date: Sun Jun 16 12:55:24 2013 +0200 Fix job-specific parameters for job groups. When a job template is instantiated via a job-group, job-specific parameters provided by the project are not respected. The correction is just a matter of updating correctly the dictionary containing all parameters. The configuration below exhibits the issue: - project: name: project-with-specific-parameters jobs: - my-job-group: recipients: "foo@example.com" - job-group: name: my-job-group jobs: - job-sending-notification-mails - job-template: name: job-sending-notification-mails publishers: - email-ext: # {recipients} should be available. recipients: "{recipients}" subject: Subject for Build ${{BUILD_NUMBER}} Change-Id: I107d8d648c8965cd125db52f3558f28337c25a63 Reviewed-on: https://review.openstack.org/33190 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/builder.py | 1 + 1 file changed, 1 insertion(+) commit 42a016bc033ee09b4bf3efadea03c3946758aac4 Author: Antoine Musso Date: Thu Jun 13 23:46:19 2013 +0200 maven: support for MAVEN_OPTS The maven build phase offers us a way to pass additional parameters to the JVM. The option is shown as MAVEN_OPTS and accept a string which is then expanded as mavenOpts. Change-Id: I0a2437e8bda1e828c09e87343f7ca5025b77182c Reviewed-on: https://review.openstack.org/32965 Reviewed-by: Arnaud Fabre Reviewed-by: Mathieu Gagné Reviewed-by: Khai Do Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/project_maven.py | 6 ++++++ 1 file changed, 6 insertions(+) commit 2fb8dee28d0107dc1f6fb72aa30d6c891dea9cb4 Author: Will Soula Date: Mon Jun 10 09:52:37 2013 -0500 Add excluded-regions and included-regions for GIT There is now code to take a list of excluded and a list of included locations. excludedRegions was removed from the mapping as it was determined not to do anything. Change-Id: I0e3003540ea1bc1aa19ef9e478be650e8c85ceaa Reviewed-on: https://review.openstack.org/32414 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/scm.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit bea3701cc592686e138ed34fcde8a15090b93f57 Author: Mathieu Gagné Date: Sun Jun 9 00:27:56 2013 -0400 Allow to override ignore upstream changes setting When ignore-upstream-changes is set to false, it will configure the job to build whenever a SNAPSHOT dependency is built. This setting is only available to Maven projects. The default value is still 'true' for backward compatibility. Change-Id: Ibdcdeef6264a68b9002a5b5bb35b90233db67e8a Reviewed-on: https://review.openstack.org/32298 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/project_maven.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 9bb8d499b1973cd79bbeaeb7d5e39d8a35ef4085 Author: Manuel Desbonnet Date: Tue Jun 4 15:27:04 2013 +0100 Add Release plugin Add support for a 'release' wrapper section which enables the Release Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Release+Plugin). Change-Id: I48e9cdd3f32c4f7e3da843b6adb58767b357b2e7 Reviewed-on: https://review.openstack.org/31650 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 63 ++++++++++++++++++++++++++++++++++++++ samples/release.yaml | 28 +++++++++++++++++ setup.py | 1 + 3 files changed, 92 insertions(+) commit e7feab1c34b4df899c49e8c23b7b9870c8ddc9b4 Author: Julian Taylor Date: Tue Jun 11 23:39:25 2013 +0200 fix invalid yaml in archive example Change-Id: I9b10a33bafdc7d4811807ff01a96f37d9343b3c6 Reviewed-on: https://review.openstack.org/32643 Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9fbdcc1be4e82f8c6e18403267eefefb4df1454d Author: Julian Taylor Date: Sun Jun 2 19:07:58 2013 +0200 change latest_only to latest-only for consistency still accepts latest_only for backward compatiblity but emits a warning Change-Id: I007d2fa2e02f15a9fd4a2eebcf5883091c8b865b Reviewed-on: https://review.openstack.org/31449 Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit c5efdd48a167ca066db6272be85e3636549b127e Author: Mathieu Gagné Date: Sun Jun 9 01:22:42 2013 -0400 Add Deploy artifacts to Maven repository publisher Change-Id: I758a34d82ca0f8404d98b27605ee5c693f6fdcdd Reviewed-on: https://review.openstack.org/32302 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 31 +++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 32 insertions(+) commit b4d41f1cf802028ba4c745ad49f08559b4403043 Author: Mathieu Gagné Date: Sun Jun 9 00:11:50 2013 -0400 Add Excluded Users support to Git SCM Add ability to provide a list of users to ignore revisions from when SCM polling is enabled with Git. Change-Id: Idb11b0afc2d8157f347e18488439d78e02f51282 Reviewed-on: https://review.openstack.org/32295 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/scm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit ec9b7d8951d066bc1ac7cb64dc0128d3b51d119d Author: Mathieu Gagné Date: Sat Jun 8 23:32:08 2013 -0400 Add Current build status to Conditional BuildStep Add support for the Current build status condition. Also fix the documentation regarding the conditional-step builder name which requires an hypen and not an underscore as previously stated. Change-Id: I6ede20c08c42d72d1ccf71c8fe6d3447d3acea90 Reviewed-on: https://review.openstack.org/32292 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) commit 4d26edcb52b53b14c07d19635c8e3c564990b688 Author: Attila Fazekas Date: Sun Jun 9 12:33:35 2013 +0200 Installation doc setup.py The setup.py is not executable and does not contains #! sign at the beginning. Change-Id: I6f3aa542eb883ade0650a33f31a8b5ffaff9a615 Reviewed-on: https://review.openstack.org/32318 Reviewed-by: Monty Taylor Reviewed-by: Antoine Musso Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 68bd76518eb9ee4d4a7a557a880e734cf9a03e67 Author: Eric Erfanian Date: Sat Jun 1 14:51:39 2013 -0500 Add support for the Team Foundation Server Plugin. Change-Id: If5cce48e12f432c7e57ce89596286d2e63796c70 Reviewed-on: https://review.openstack.org/31400 Reviewed-by: Jeremy Stanley Reviewed-by: Clark Boylan Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/scm.py | 124 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 125 insertions(+) commit c6135c72c3e3ab572fcb8adb9f602696d3962a66 Author: Julian Taylor Date: Sun Jun 2 18:46:27 2013 +0200 add post build workspace cleanup publisher Change-Id: Id541aaa8173202bf141f389c7258e0dd43b39472 Reviewed-on: https://review.openstack.org/31448 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 73 ++++++++++++++++++++++++++++++++++++ jenkins_jobs/modules/wrappers.py | 6 ++- setup.py | 2 + 3 files changed, 79 insertions(+), 2 deletions(-) commit 35c0113a84d572b38e98b0e4dd47bfc7e6728615 Author: Will Soula Date: Tue May 28 14:21:42 2013 -0500 Adding Build User Vars support Adding support for the Build User Vars plugin. This plugin exposes new environment variables of who started a build, if it was started manually. Change-Id: I731419f26a9e59800ea2209d1c5a659a1b6cd483 Reviewed-on: https://review.openstack.org/30785 Reviewed-by: Khai Do Reviewed-by: Jeremy Stanley Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 14 ++++++++++++++ setup.py | 1 + 2 files changed, 15 insertions(+) commit 82cbf9795e349fb55921881824b1cd63c995851a Author: Will Soula Date: Tue May 21 10:38:49 2013 -0500 Fixing copyartifact to work with latest version Version 1.26 of the copy artifact plugin changed the xml from projectName to project. This change is making that same change. I don't know if we, somehow, want to support the older version of the copy artifact plugin. Change-Id: I98b25649521d6d34380eea6597a4015d2d929ebc Reviewed-on: https://review.openstack.org/29940 Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 3 +++ 1 file changed, 3 insertions(+) commit 518a25d35f114e35ce6c742d947b58a2a49886ec Author: Will Soula Date: Mon May 20 09:17:19 2013 -0500 Adding Jabber Plugin This change adds support for the Jabber plugin so Jenkins can report results to chat rooms. This change also fixes a misspelling of trigger in the documentation of the join-trigger functionality. Change-Id: I69659b106c6e1730506ee8150df8c07c1be27254 Reviewed-on: https://review.openstack.org/29779 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 94 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 95 insertions(+) commit af88ce018529dac5529bd1824d8e45c8e8fe2f5a Author: Will Soula Date: Tue May 14 15:19:54 2013 -0500 Fixing ant java opts The java-opts were being passed to ant with a new line in between each option. This causes ant to choke and throw a usage of java message and then exit with a success. This is not good. Now the java options are passed with a space in between each one. Change-Id: I6921dfd396d91eed112442503afc1d35e942af6e Reviewed-on: https://review.openstack.org/29127 Reviewed-by: Clark Boylan Reviewed-by: Khai Do Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 8bd3567adbf693b858a8bb448ead0d3290c9d776 Author: Eric Erfanian Date: Sun May 12 19:30:14 2013 -0500 Add support for the performance plugin. Throws an error when invalid values are provided. Also fix a minor spelling error. Change-Id: Ib32fffbbdab89f072894e675a43eecfb0fff983d Reviewed-on: https://review.openstack.org/28916 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 88 +++++++++++++++++++++++++++++++++++- setup.py | 1 + 2 files changed, 88 insertions(+), 1 deletion(-) commit 61f9fb84cb54af96144c8a1144f1d5c2bcd4ab11 Author: Will Soula Date: Fri May 10 07:27:28 2013 -0500 Pass svn revision to triggered jobs This change adds the ability to pass the subversion revisions that were used in the build to the downstream builds. Added passing current-build parameters to downstream jobs triggered in the post build actions, to keep builders and publishers in sync. Noticed arg type for git-revision was incorrect and changed it to bool from str. Change-Id: I029c1d88b23e08ac2546a92018fef06c22c357b1 Reviewed-on: https://review.openstack.org/28793 Reviewed-by: Khai Do Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 6 ++++++ jenkins_jobs/modules/publishers.py | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) commit d753ed3ec04c497515c73fa23eb70b49c3448231 Author: Eric Erfanian Date: Fri May 3 12:24:12 2013 -0500 Enhance support for the Cobertura Coverage Plugin. Deprecates the coverage module. Increases the amount of recognizable parameters, modularizes existing parameters and maintains default values. Modularizes the construction of coverage reports. Coverage reports can now be fully specified within JJB YAML. Coverage reports now use a default value of zero for healthy, unhealthy, and unstable. Additionally, at least one target must be specified. Coverage module gets a documentation and logger warning against its use. Logger object moved to the head of the code. Change-Id: I505a6185b3f9005fbbd9786ebdca0ef02ed618f0 Reviewed-on: https://review.openstack.org/28184 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 118 +++++++++++++++++++++++++++++++++++- setup.py | 1 + 2 files changed, 118 insertions(+), 1 deletion(-) commit 73540705e1253f8b0537d67ca406ed7e5b85b17d Author: James E. Blair Date: Wed May 8 14:02:33 2013 -0700 Make it easier to run in place. Without installing. Change-Id: I63f322178aacef51b559cc04899d8dec7c67a219 Reviewed-on: https://review.openstack.org/28613 Reviewed-by: Khai Do Reviewed-by: Monty Taylor Reviewed-by: Antoine Musso Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/cmd.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) commit 85cf7a414e4ce0f478da81db11c3393d02fdb1f9 Author: Antoine Musso Date: Fri Apr 12 14:16:23 2013 +0200 only generate XML for requested jobs The updated and test commands generated the XML for all the jobs, even if we were only interested by a specific job. This patch pass the job names requested to the job builder so the XML generation function can skip jobs we are not interested in. Note that we still have to expand job templates to find out if the expanded job name match the filter. Change-Id: I3db6bc3b07b0bfe71019c19c2d3d02bced1e25ac Reviewed-on: https://review.openstack.org/26839 Reviewed-by: Jesse Keating Reviewed-by: Spencer Krum Reviewed-by: Jeremy Stanley Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) commit 56083ed5d492fe9b6af6bcd05edafe5d358181ad Author: Will Soula Date: Fri May 3 08:21:47 2013 -0500 Adding merge before build to git This change adds the ability to merge to a specific repoistory and branch based on the values entered. The intent was to make the new parameters 'remote' and 'branch' only be used if 'merge' is specified Change-Id: Iab9db6d4ca6ff608bf946b9a38cc0756d6a78b86 Reviewed-on: https://review.openstack.org/28148 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/scm.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 09cde46adc22a76e9c8d7b466ffa5074616fe0d9 Author: Arnaud Fabre Date: Wed May 1 23:00:19 2013 +0200 maven-target: Expose maven version and pom location. These parameters are configurable in Jenkins, and should be in Jenkins Job Builder too. Change-Id: Ia6ac92cf687ef36a99140c65dfd4bc7f7162ecf8 Reviewed-on: https://review.openstack.org/27964 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 9 +++++++++ 1 file changed, 9 insertions(+) commit 490affeee8341b1217de810e9ab39ba2bd014043 Author: Eric Erfanian Date: Thu May 2 20:16:43 2013 -0500 add support for building with grails Change-Id: Ie5caf99bdbe6f6f5493511d2710ee04747fb0494 Reviewed-on: https://review.openstack.org/28125 Reviewed-by: Jeremy Stanley Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 82 ++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 83 insertions(+) commit eb1a2c53247a705452cba05e72a293f8795b9f4a Author: Eric Erfanian Date: Wed May 1 21:26:11 2013 -0500 Add support for the promoted builds plugin. Change-Id: I393f1c4d47253fbe53f774c5e60cd20f65b5348e Reviewed-on: https://review.openstack.org/28005 Reviewed-by: Jeremy Stanley Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/properties.py | 28 ++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 29 insertions(+) commit ab88ac0a479e27ac5fe2730b40f2a59300eb3ec8 Author: Arnaud Fabre Date: Thu May 2 00:23:43 2013 +0200 email-ext: Expose reply-to and attach-build-log. Options are self-explanatory hopefully. Change-Id: I928851ebdaeb75f785d990008792d6a9e72512e3 Reviewed-on: https://review.openstack.org/27965 Reviewed-by: Jesse Keating Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 9 +++++++++ 1 file changed, 9 insertions(+) commit cda1b45e2df0bb273e24292fa34a4d92ce4ff10f Author: Eric Erfanian Date: Mon Apr 29 21:21:50 2013 -0500 Add support for custom gradle version aka gradleName Change-Id: Ib74bcf852e128a8dfc1a297c5b9dc2571e5666ff Reviewed-on: https://review.openstack.org/27791 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 4 ++++ 1 file changed, 4 insertions(+) commit d74a4d873964f8f5b03c3b55d65cc4fa4cec62b0 Author: Arnaud Fabre Date: Sun Apr 28 20:06:44 2013 +0200 matrix jobs: Add slave axis support. This commit builds on the structure introduced by Ib2f36e10c1c5fb14f0e4255f35c0bf19c2cc39b3. Slave axis has the same XML structure than other axes, only the element name changes. Change-Id: Ie1d2ef96c7a7d9aa02066ff055ead7c84011bdc6 Reviewed-on: https://review.openstack.org/27656 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/project_matrix.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit e8e49344b16644663f7a9335f88f2b4ef96f19aa Author: Arnaud Fabre Date: Sun Apr 28 20:25:53 2013 +0200 PublishOver: Expose several options. Plugins in the Publis Over * series can be configured to: - fail the build when transfer fail (fail-on-error), - delete remote directory before tranfering files (clean-remote), - create a directory using current date (target-is-date-format). Theses properties are now configurables in Jenkins Job Builders for the cifs, ftp and ssh variants. Change-Id: I3808bb577809d4197bfc57f3dc4b2ca8e04ff073 Reviewed-on: https://review.openstack.org/27655 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) commit 18e5025bb7956fbdf1645902fdee6fb72ad84988 Author: Arnaud Fabre Date: Sun Apr 28 20:42:43 2013 +0200 Add msbuild plugin support. This is a simple plugin to wrap msbuild tool, which is used for building .NET projects. Change-Id: I0803d4477d9132265e559ad40b8c1a981a2cd5ef Reviewed-on: https://review.openstack.org/27654 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 38 ++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 39 insertions(+) commit 20c9f80ab8ff9f7b4e0f2a369fdc06fd49653f32 Author: Arnaud Fabre Date: Sun Apr 14 21:42:10 2013 +0200 Add support to the Conditional BuildStep plugin. This plugin, as its name implies, permits to execute build step conditionaly. Reusing other builders supported by Jenkins Job Builder is tricky since when only one step is involved, the markup generated by the sub-builder must be tweaked. XML nodes created by sub-builders are added to a dummy node, which makes their retrieval and tweaking possible. The tweaking consists of transforming a node into . Change-Id: I96bb6af6a9f93e314bc0c531382b87bba7ac9e67 Reviewed-on: https://review.openstack.org/26050 Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 150 ++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 151 insertions(+) commit 38f57ae400abf6d3c656c6b1a8d6197d93a4157e Author: Arnaud Fabre Date: Sun Apr 14 21:36:20 2013 +0200 Make reuse of builders/publishers inside other components easier. Some Jenkins plugins depend on other plugins, and their configuration section is a mix of both plugins. For Jenkins Job Builder, that means reusing one component directly from another one. Driving the generation of XML markup is the job of Base._dispatch. Unfortunately, components do not have access to their module object, and even if their could, _dispatch would still be a non-public method. Refactor Base._dispatch into ModuleRegistry.dispatch, which can be used from any place where the parser is available. Base and ModuleRegistry are extended so that the registry can discover which entry point must be used for each module, if appropriate. ModuleRegistry.dispatch signature can be simplified by dropping component_list_type parameter. Change-Id: Ie9d090817d0c2d464745b5634a22d3cea6a47ab1 Reviewed-on: https://review.openstack.org/26051 Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins doc/source/extending.rst | 12 ++++++ jenkins_jobs/builder.py | 62 +++++++++++++++++++++++++++ jenkins_jobs/modules/base.py | 74 +++++++-------------------------- jenkins_jobs/modules/builders.py | 7 +++- jenkins_jobs/modules/notifications.py | 7 +++- jenkins_jobs/modules/parameters.py | 7 +++- jenkins_jobs/modules/properties.py | 6 ++- jenkins_jobs/modules/publishers.py | 6 ++- jenkins_jobs/modules/reporters.py | 6 ++- jenkins_jobs/modules/scm.py | 6 ++- jenkins_jobs/modules/triggers.py | 6 ++- jenkins_jobs/modules/wrappers.py | 6 ++- 12 files changed, 127 insertions(+), 78 deletions(-) commit 50134954e8c61705062e98d47303c2ba7cea74f5 Author: Kiall Mac Innes Date: Fri Apr 12 00:00:12 2013 +0100 Add suport for the Publish over SSH plugin. Change-Id: Id06bd57c1d290df98c05b3cb19066013635199a3 Reviewed-on: https://review.openstack.org/26831 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 38 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 39 insertions(+) commit 5413f9dfb9ebe67c76bb3e4a4a1af467900672f2 Author: Antoine Musso Date: Fri Apr 12 13:03:35 2013 +0200 `test` can now takes several job names Make the test command to accept several job names. This is exactly like the change I have made for `update` in 4f5cfb1 (and fixed in fc86fbe). Change-Id: I68d634b29e4a8ff16818ddeb6f90c7ff072c93a5 Reviewed-on: https://review.openstack.org/26838 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0941c3ad36896a8ef9ef245016e860e1484fa4ac Author: Kiall Mac Innes Date: Sun Apr 7 13:01:59 2013 +0100 Add support for the MultiJob plugin Change-Id: Ie6c06072eae17fddf241fa0bc416d20c9a2248dc Reviewed-on: https://review.openstack.org/26321 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 100 ++++++++++++++++++++++++++++++ jenkins_jobs/modules/project_multijob.py | 65 +++++++++++++++++++ setup.py | 2 + 3 files changed, 167 insertions(+) commit 7c4ef7389eb52b369fb4e2845d0b38b45d1ae828 Author: Will Soula Date: Tue Apr 2 18:36:34 2013 -0500 Documentation fixes There are three doc fixes for builders.py in this change. Link to Gradle plugin fixed Maven-target example has been fixed Copyartifact docs cleaned up Change-Id: Ie50e94ace2041735cc986eb117597262b40b0fa5 Reviewed-on: https://review.openstack.org/25962 Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 42 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) commit f497a1546caf664262570bb93c670b4768f7d2d4 Author: Kiall Mac Innes Date: Sun Apr 7 11:13:46 2013 +0100 Add support for join trigger publisher Change-Id: Ifbfb28fd61092f15d7960f5dfc8ba57992607464 Reviewed-on: https://review.openstack.org/26318 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 21 +++++++++++++++++++++ setup.py | 1 + 2 files changed, 22 insertions(+) commit 38a67b622caba4454e3445a8ea59df273753f469 Author: Kiall Mac Innes Date: Sun Apr 7 11:11:14 2013 +0100 Add support for password parameters Change-Id: Iaab1d59c6e01fb95f5c8cd012dbc73379c92174e Reviewed-on: https://review.openstack.org/26317 Reviewed-by: Monty Taylor Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/parameters.py | 20 ++++++++++++++++++++ setup.py | 1 + 2 files changed, 21 insertions(+) commit 96a72de938ed75812175410e9c1bad6906778a11 Author: James E. Blair Date: Fri Apr 5 13:25:03 2013 -0700 Add jenkins-jobs command line tool. So that jenkins-jobs can be easily run for testing from the source dir without installation. Change-Id: Iabba59ad32ccd4b79eb8934e53c6d747110a06b0 Reviewed-on: https://review.openstack.org/26259 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins tools/jenkins-jobs.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit 54b6bcc44dea3271b95269fc3bea14da41bc899d Author: Arnaud Fabre Date: Thu Apr 4 01:19:28 2013 +0200 Maven: Fix XML markup. The generated markup contains a node "root_module", which is not recognized by Jenkins: WARNING: Skipping a non-existent field root_module com.thoughtworks.xstream.converters.reflection.MissingFieldException: No field 'root_module' found in class 'hudson.maven.MavenModuleSet' The correct spelling is rootModule. Change-Id: I0cae2c3358f2664783c97e245b064453a05bc988 Reviewed-on: https://review.openstack.org/26052 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/project_maven.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 86095769859922a4a28a0079db5d28f3811caf73 Author: Will Soula Date: Tue Apr 2 13:58:54 2013 -0500 Adding 'switches' to gradle This change adds the ability to specify switches to be passed to gradle. This change was only two functional code lines and several lines of documentation. The only file that changed was builders.py Change-Id: Idb1199cd4a63e6fbfdabe57cf50a8b431dd9e914 Reviewed-on: https://review.openstack.org/25929 Reviewed-by: Tollef Fog Heen Reviewed-by: Arnaud Fabre Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit bc235fdfc97a7e91141416065ca09255a4817f13 Author: Javier Martinez Canillas Date: Mon Apr 1 14:55:56 2013 +0200 add an auth-token YAML parameter for the General Job Configuraion module Using the Jenkins WEB UI an Authentication Token can be specified for jobs to allow builds to be triggered remotely by using the URL: JENKINS_URL/job/JOBNAME/build?token=TOKEN Add an auth-token job parameter to generate the XML element. Change-Id: Ic916e4074c9b2de9c616ef39a88c1d8e1e91fcff Signed-off-by: Javier Martinez Canillas Reviewed-on: https://review.openstack.org/25819 Reviewed-by: Arnaud Fabre Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 5 +++++ doc/source/general.rst | 5 +++++ jenkins_jobs/modules/general.py | 2 ++ 3 files changed, 12 insertions(+) commit 2cd1e7fb9d48436b46db048925c5493d2fb3e5f9 Author: Antoine Musso Date: Tue Mar 26 21:12:15 2013 +0100 matrix jobs now supports user-defined axes The XML definition of a user defined axes is the same as a a labeled expression axis. Only the XML element name change, adding support for user defined axis is thus only a matter of adding a map between our YAML values and Jenkins XML element name. Change-Id: Ib2f36e10c1c5fb14f0e4255f35c0bf19c2cc39b3 Reviewed-on: https://review.openstack.org/25432 Reviewed-by: Arnaud Fabre Reviewed-by: Clark Boylan Reviewed-by: Khai Do Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/project_matrix.py | 39 ++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) commit 78d5cd15adfb5df368ce15ed70ef8995d03def66 Author: Arnaud Fabre Date: Fri Mar 29 00:20:23 2013 +0100 gerrit: Add file paths filtering support. Gerrit Trigger allows to restrict triggering of build depending on which files are modified in the change. Expose this capability with a new property file-paths. Also cleanup documentation (omissions and formatting errors). Change-Id: I4bfc5ab03a10622fdb5730a294037add8c1ad54f Reviewed-on: https://review.openstack.org/25569 Reviewed-by: Antoine Musso Reviewed-by: Clark Boylan Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 30 +++++++++++++++++++++++++++--- samples/gerrit-trigger.yaml | 3 +++ 2 files changed, 30 insertions(+), 3 deletions(-) commit c632944a97f768c68063e956d4a43cb20e981122 Author: Will Soula Date: Tue Mar 26 11:51:09 2013 -0500 Adding Top-Level Maven Targets Adding ability to use top-level maven targets within your build. This is a change to the builders file and setup.py to add the new functionality. Change-Id: I7ae24b82d0b0ba4e81eda67045131733ced1dc46 Reviewed-on: https://review.openstack.org/25413 Reviewed-by: Khai Do Reviewed-by: Arnaud Fabre Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/builders.py | 27 +++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 28 insertions(+) commit 97f9c072e87476e338fd8a121021a61640df5a18 Author: Antoine Musso Date: Thu Mar 14 09:32:32 2013 +0100 prevent duplicate XML expansion of job templates Whenever a project has different values for a project and that parameter is not used in the template, we ended up regenerating the exact same job. This patch getXMLForTemplateJob() to make it remember whether an expanded template has already had its XML generated. I am using json which let us serialize an arbitrary data structure and more specially let us sort the dictionary keys to make sure we always end up with the same serialization. The `test` time for my setup went from 34 seconds down to 17 seconds. Change-Id: I8f4ea2780025fefd3ba58e2ed32d4bd762093acf Reviewed-on: https://review.openstack.org/24409 Reviewed-by: Arnaud Fabre Reviewed-by: Jeremy Stanley Reviewed-by: Khai Do Reviewed-by: Monty Taylor Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) commit a164f01f4abdd93a310428f5cbe4feccec4b6d0a Author: Arnaud Fabre Date: Fri Mar 22 21:13:56 2013 +0100 Add Sonar Plugin support. The Sonar Plugin provides both a builder and a publisher, the later targeting Maven projects. This commit adds support for the publisher, which is straightforward to configure: no option is required, the plugin finds suitable defaults by itself. Several parameters can be provided though, which are transferred as is to either Sonar or Maven. Analysis can also be skipped under certain conditions. Change-Id: I30744d0961d623cabf7c0780ab2f0d4db2cd9295 Reviewed-on: https://review.openstack.org/25073 Reviewed-by: Jeremy Stanley Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 55 ++++++++++++++++++++++++++++++++++++ samples/sonar.yaml | 13 +++++++++ setup.py | 1 + 3 files changed, 69 insertions(+) commit 1c0b7308c83680fb259ea15518e4426198b9f99a Author: Will Soula Date: Wed Mar 20 15:05:22 2013 -0500 Adding GitHub Pull Request Builder Plugin Adding the ability to use the GitHub Pull Request Builder plugin. This plugin requires modifications on the Configure System page of Jenkins to work properly. If using GitHub Enterprise you must set the token on this page, password does not work. This change affects the modules/triggers.py and setup.py file, adding a new section for this plugin. When using this plugin in the GUI the textboxes for admin list and crontab will default to the values stored on the main Configure System Jenkins page, I don't think JJB can even attempt this default so I just defaulted to nothing. Change-Id: Ib453cee269038e04f01a446378922b36307c18ce Reviewed-on: https://review.openstack.org/24929 Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 39 ++++++++++++++++++++++++++++++++++++++ setup.py | 2 ++ 2 files changed, 41 insertions(+) commit 3e6dac460213f4d303c264f15d316cb6c0fec702 Author: Antoine Musso Date: Thu Mar 14 06:47:11 2013 +0100 job cache now varies by remote url When updating different Jenkins installations, JJB would end up invalidating the job cache. By adding the jenkins.url in the cache file name, we can maintain a job cache per remote Jenkins instance. Name of the cache file is based on Jenkins URL. Change-Id: Ib9c08d8029267729e7a030a4e8bc0a9f05eb8ce3 Reviewed-on: https://review.openstack.org/24404 Reviewed-by: Arnaud Fabre Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins doc/source/installation.rst | 13 +++++++------ jenkins_jobs/builder.py | 9 ++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) commit cd3cbd91cb8040f9007848d3cd68272428193563 Author: Will Soula Date: Mon Mar 18 14:03:58 2013 -0500 Jobs not tied to a node can roam Previously if you did not specify a node for a job to build on then the job would be marked as tied to master. The checkbox for 'Restrict where this project can be run' would be checked but nothing entered into the textbox so it ended up tied to master. This change adds an else to the check for 'node' and if 'node' is not found then canRoam is set to true. This is a two line change to modules/general.py Change-Id: Id7e40ba5ae2eaa92fd7678da7b3acefc1ba4ee32 Reviewed-on: https://review.openstack.org/24669 Reviewed-by: Khai Do Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/general.py | 2 ++ 1 file changed, 2 insertions(+) commit f2ea8405c14552b6f01eb0762e9378fb988edb50 Author: Antoine Musso Date: Thu Mar 14 14:47:59 2013 +0100 job now supports a custom workspace In Jenkins, the job advanced options has a tick box to enable a workspace space different from the default provided internally by Jenkins. The XML element is . Change-Id: Ia432d98523a7cb617c1236acb52821a82b67c8e7 Reviewed-on: https://review.openstack.org/24427 Reviewed-by: Arnaud Fabre Reviewed-by: James E. Blair Reviewed-by: Khai Do Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins doc/source/configuration.rst | 5 +++++ doc/source/general.rst | 5 +++++ jenkins_jobs/modules/general.py | 3 +++ 3 files changed, 13 insertions(+) commit fc86fbe455eaa9deff5eaa412799c51a3c2e670c Author: Antoine Musso Date: Mon Mar 18 22:25:13 2013 +0100 restore ability to pass multiple jobs on 'update' 4f5cfb17 gave us the ability to pass multiple job names when running the `update` command. Unfortunately the argument parser was made to request at least one argument. a0ccb45c fixed it to be one optional argument which in turn broke the ability to pass several jobs. This patch makes the names argument to consume all remaining arguments and not require any. Change-Id: I4723117d607f7e10223985fdcbdd50fc5ca50183 Reviewed-on: https://review.openstack.org/24711 Reviewed-by: will soula Reviewed-by: Khai Do Reviewed-by: Antoine Musso Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2da55cf55222ff926592fecea463ceeed5b4652a Author: Arnaud Fabre Date: Tue Mar 19 01:31:14 2013 +0100 gerrit: Use hyphenated key names. Hyphenated strings are now standard in Jenkins Job Builder. Gerrit Trigger Plugin support used camelCase keys for its configuration, and is updated to use hyphenated strings. Old configuration style is still supported: if old key names are found, they are converted to new style key names. Change-Id: I3b1968f14029b69497ee543b44070db7d9c3448c Reviewed-on: https://review.openstack.org/24730 Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Reviewed-by: Anita Kuno Approved: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 137 ++++++++++++++++++++++++++------------ samples/gerrit-trigger.yaml | 30 ++++----- 2 files changed, 108 insertions(+), 59 deletions(-) commit 4ba9ebe4d3fc193e1bf4374994bf62d06ded53b9 Author: Arnaud Fabre Date: Wed Mar 13 00:14:13 2013 +0100 gerrit: Add support for skipVote. Newer versions of gerrit-trigger permit builds to forbear, depending of the build outcome (success, failure, etc.). This capability is exposed in jenkins-job-builder, with suitable defaults. Change-Id: I25e267459b93b8e18a690c4d38989196ca1298f3 Reviewed-on: https://review.openstack.org/24265 Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Reviewed-by: Anita Kuno Reviewed-by: Khai Do Approved: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 29 +++++++++++++++++++++++++++++ samples/gerrit-trigger.yaml | 6 ++++++ 2 files changed, 35 insertions(+) commit 47dc5442e669b2c2a1295933962c2ae0f21884e2 Author: Arnaud Fabre Date: Tue Mar 12 23:22:04 2013 +0100 gerrit: Add support for on changed restored/abandoned. These triggers are supported starting at gerrit-trigger 2.8.0. Using thoses triggers in a previous version should not cause any problem. Change-Id: I388cfb9424dd16dc436010c492e59dd0e896b69a Reviewed-on: https://review.openstack.org/24264 Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Reviewed-by: Anita Kuno Approved: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 6 ++++++ samples/gerrit-trigger.yaml | 2 ++ 2 files changed, 8 insertions(+) commit e0787f281593bb183e85147e353dec055d62b218 Author: Arnaud Fabre Date: Tue Mar 12 23:19:47 2013 +0100 gerrit: Support gerrit-trigger >= 2.6.0. Gerrit-trigger offers different triggers, stored in config file using different formats. During development of version 2.6.0, the following markup was used[1]: true true false false That markup changed before the release of 2.6.0 [2] to: Adjust the generated XML tree to match what gerrit-trigger expects. This means that gerrit-trigger versions < 2.6.0 are no longer supported. Trigger on draft published, added in 2.6.0, is now supported. [1] Commit 8bee93a87b59d413ccec0aa84d3da10adb108eb9 [2] Commit 9ba008972a84e3ca8b2a90bd6d21295e7d7f4f94 Change-Id: I7160de1284c53d20f435e5af0d5a64b2e17c4196 Reviewed-on: https://review.openstack.org/24263 Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Reviewed-by: Anita Kuno Approved: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 45 +++++++++++++++++++++++++------------- samples/gerrit-trigger.yaml | 1 + 2 files changed, 31 insertions(+), 15 deletions(-) commit 2370375aee018e30ab345a2f3b60c0ec801f2a68 Author: Arnaud Fabre Date: Tue Mar 12 22:56:06 2013 +0100 gerrit: Make triggerOn* parameters really use boolean values. Parameters triggerOn* are documented as boolean, however, using values like true or false results in exception "TypeError: cannot serialize True (type bool)". Theses values have special meaning in yaml, and are not loaded as string in python. It was hence required to use quotes to make it work. Add a sample using thoses attributes as an example. Change-Id: Iccbda8ebc0867e173fa7ccab78db16874ddb2a45 Reviewed-on: https://review.openstack.org/24262 Reviewed-by: James E. Blair Reviewed-by: Khai Do Reviewed-by: Anita Kuno Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 10 +++++----- samples/gerrit-trigger.yaml | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) commit a0ccb45c5776b0e33990590f01857af1b2f17e37 Author: Will Soula Date: Mon Mar 18 15:06:58 2013 -0500 'names' argument to update no longer required Before the change to allow 'update' to take multiple jobs the 'names' argument was not required and passing just the yaml file would create all the jobs inside it. The 'update' change made names required when it shouldn't be. This is a one line change to cmd.py to change nargs from '+' back to '?' Change-Id: I65372d78ec678b9c29caad2ea573772287a7642f Reviewed-on: https://review.openstack.org/24673 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a35063b666983b32abad7947a54376b4789ded74 Author: Timo Tijhof Date: Thu Mar 14 07:41:34 2013 +0100 doc/configuration: Fix incorrect name "defaults" See YamlParser#applyDefaults in builder.py. Change-Id: I763d23608b79f7b1c560ae41cf5ca0d2dcc19d60 Reviewed-on: https://review.openstack.org/24407 Reviewed-by: Anita Kuno Reviewed-by: Arnaud Fabre Reviewed-by: Elizabeth Krumbach Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4f5cfb178f0c5bf666ef5c132ce4531701815ec1 Author: Antoine Musso Date: Tue Mar 12 12:15:16 2013 +0100 `update` can now takes several job names Just like `delete` can accept several jobs names as argument, this patch let us do the same with `update`. * builder.update_jobs now filter the jobs against a list * renamed 'update' argument 'name' to 'names' to make it clear it accepts several job names. Change-Id: I4bcebd98073ec89e172afbec59b93d14de6620ff Reviewed-on: https://review.openstack.org/24160 Reviewed-by: Anita Kuno Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins doc/source/installation.rst | 5 +++++ jenkins_jobs/builder.py | 7 ++++--- jenkins_jobs/cmd.py | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) commit 94a50bb3d1261e89d275ac6104ac15c2fe3155d8 Author: Mark Holmquist Date: Fri Mar 8 12:52:58 2013 -0800 Add multi-SCM capabilities Jenkins has a multiple-SCM option. We can just support that by using it when more than one SCM module is defined. Simple enough. Change-Id: Iacfba5c547ff111304644a4777a12a70b0b22e62 Reviewed-on: https://review.openstack.org/23961 Reviewed-by: Monty Taylor Reviewed-by: Antoine Musso Reviewed-by: James E. Blair Reviewed-by: Khai Do Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/scm.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 22af0e3d4970976bae8e5600fc6cf5b8ba3a11d6 Author: Mark Holmquist Date: Fri Mar 8 16:53:40 2013 -0800 Fix checkstyle documentation This is following the style of the artifact-resolver builder, which has other nested dictionaries also. Change-Id: I26b909e18239df03c123e07791fa7a3549be7701 Reviewed-on: https://review.openstack.org/23977 Reviewed-by: Monty Taylor Reviewed-by: Khai Do Reviewed-by: Antoine Musso Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) commit 27d1d25e20e3cdbe32a556a6b72bab9bfba43d7f Author: Mark Holmquist Date: Fri Mar 8 14:05:52 2013 -0800 Document current-params option for trigger-build There was some documentation missing, so I had to find this option when I was trying to add it myself, in the source code. Nasty! Added documentation so nobody else has to do that. Change-Id: I9b6a0227479b600fed213d926f5cd22981db612e Reviewed-on: https://review.openstack.org/23963 Reviewed-by: Monty Taylor Reviewed-by: Khai Do Reviewed-by: Antoine Musso Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 3 +++ 1 file changed, 3 insertions(+) commit 35c2cdb7a0575e7083735a823db8d88bbd5c6a6c Author: Arnaud Fabre Date: Wed Mar 6 22:33:01 2013 +0100 ftp, cifs: Make optional prefixes really optionals. Excludes and remove were marker optional, but weren't in practice. Provides defaults values so that they are really optional. Change-Id: I6bd6f5183d888b0716bdf5690fc19bcd91bfc856 Reviewed-on: https://review.openstack.org/23864 Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 66141586bade6acf1300260a3f4e63436f167799 Author: Arnaud Fabre Date: Wed Mar 6 22:32:57 2013 +0100 ftp: Refactor using base_publish_over. The subtlety is that Publish Over FTP offers additional options compared to the CIFS variant. This is done by customizing the XML tree created by base_publish_over. Change-Id: I5ff3614781cb52a47bf9816c2326d3fe9a96a47f Reviewed-on: https://review.openstack.org/23863 Reviewed-by: Clark Boylan Reviewed-by: Khai Do Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 48 +++++++++++------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) commit 21370239e038447f149b990c04d96bd12898e1dc Author: Arnaud Fabre Date: Wed Mar 6 22:32:54 2013 +0100 cifs: Externalize common code to base_publish_over. The various Publish Over... plugins offer a similar configuration structure. Externalizing that knowledge will allow reuse between modules. Change-Id: I8dd7f62713da013354c656e9437522210e2c39f9 Reviewed-on: https://review.openstack.org/23862 Reviewed-by: Clark Boylan Reviewed-by: Khai Do Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 78 +++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 33 deletions(-) commit 11d45093495e9d88549ec305b88c016a0367c141 Author: Arnaud Fabre Date: Wed Mar 6 22:32:50 2013 +0100 publishers: Add support for Publish over CIFS. Projects might need to publish artifacts on Windows shares, which is possible with the CIFS variant of Publish Over plugins. The provided support is mostly similar to the existing ftp support. Change-Id: Ic313f579158fb6460ab934f705b9c512b1131ca2 Reviewed-on: https://review.openstack.org/23861 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 58 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 59 insertions(+) commit b1cfa3bb5a346814262f1b2b1d7e602d0fef25e0 Author: Will Soula Date: Mon Mar 4 10:39:50 2013 -0600 Build when a change is pushed to GitHub Added ability to build when a change is pushed to github, to the triggers. This change is changing the triggers.py file and follows the poll scm as a template for the change. Setup.py was also changed to enable the new feautre. There is outside changes needed to Jenkins and/or github to fully use this feature. You need to tell Jenkins whether to automatically manage the github repos or you need to put the correct URL into the webhook. Furthermore, at the current time it is necessary to set both github and pollscm for this to work. In the future this may not be necessary so setting github does not automatically set pollscm. Change-Id: Id7b48fa47f63669ba31282a403f07a1234e7ac31 Reviewed-on: https://review.openstack.org/23433 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 16 ++++++++++++++++ setup.py | 1 + 2 files changed, 17 insertions(+) commit 478eec7da96f7561c6f6bf720383c3ee6740854e Author: Will Soula Date: Mon Mar 4 10:27:24 2013 -0600 Property file for parameterized downstream jobs Added ability to specify parameters from properties file for parameterized build on other projects. This change follows the predefined-properties code as a template for how to do the work. This is a change to only the publishers.py file. Change-Id: I4b3500dc9b4f50450475aa8441854fa6b5b0ccb0 Reviewed-on: https://review.openstack.org/23432 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit 93d843c698e9dcdffc2b19ece21220795119937a Author: Will Soula Date: Wed Feb 27 10:46:17 2013 -0600 Adding ability to specify Java Options to Ant You can now specify the Java Options to pass to ant. The leading dash is needed and multiples are specified like: java-opts: - "-ea" - "-Xmx512m" I only changed the builders.py file and I followed the properties section above my change as a template. Change-Id: Ifa3d06a53b160444224f308d36e7b2bd903591bd Reviewed-on: https://review.openstack.org/23097 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit b60770597adc436f77d5f410c9c0bfe629be92da Author: Clark Boylan Date: Thu Feb 28 15:37:42 2013 -0800 Stop referring to openstack/openstack-ci-puppet. The openstack/openstack-ci-puppet repo moved and became openstack-infra/config. Remove references to openstack-ci-puppet and replace them with references to openstack-infra/config. Change-Id: I75e7797995b894b6053901dbcfa351404048ea7c Reviewed-on: https://review.openstack.org/23227 Reviewed-by: Khai Do Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/installation.rst | 2 +- tools/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 02576e834292b47a8b3a0cabcbef1a1fdcd63f57 Author: Kiall Mac Innes Date: Thu Feb 21 15:54:28 2013 +0000 Add support to copyartifact builder for flattening dirs Change-Id: I72278b220dcd61dd323da91c8cbd0282b8d0f97c Reviewed-on: https://review.openstack.org/22556 Reviewed-by: Clark Boylan Reviewed-by: Khai Do Reviewed-by: Kiall Mac Innes Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/builders.py | 4 ++++ 1 file changed, 4 insertions(+) commit 2cc998a7988a88528b573d62cdd4762bb55ace42 Author: Kiall Mac Innes Date: Thu Feb 21 15:35:15 2013 +0000 Add support for passing git revision through a parameterized build trigger. Change-Id: Id937a278b04f2a590e9b1606b18634f584032bb8 Reviewed-on: https://review.openstack.org/22555 Reviewed-by: Monty Taylor Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) commit 7a5cbdbb7a94ba024765088a6bb528028345c211 Author: Will Soula Date: Tue Feb 12 12:38:30 2013 -0600 Fixing svn-tags to work correctly It was discovered that when using svn-tags functionality that when you go to build the list is not populated. If you just saved the job in Jenkins then it would work correctly. It was determined that the tag was missing and this was needed for the parameter to work. In testing it was found that simply putting 1-1-1-1-1 into the config would make the svn-tags functionality work like expected. This is a one line change to add the uuid element set to 1-1-1-1-1 Change-Id: Iea1c27ebc9aa7c17f4f390c375989240c1941ce0 Reviewed-on: https://review.openstack.org/21809 Reviewed-by: Khai Do Reviewed-by: Monty Taylor Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/parameters.py | 1 + 1 file changed, 1 insertion(+) commit d0a0484594538a797075f49f58f8d4629480835c Author: Will Soula Date: Mon Feb 4 15:23:48 2013 -0600 Copy Artifact Plugin now specifies which build The Copy Artifact Plugin has been extended to allow you to specify which build to get. There has been a dictionary created to validate the value passed is correct and another dictionary has been created to validate the permalink passed, if that option is selected. There are also parameters added for several of the ways to select a build. Change-Id: I71bbdcaada184736cc30e6390751aff1a864f9d5 Reviewed-on: https://review.openstack.org/21150 Reviewed-by: Clark Boylan Reviewed-by: Khai Do Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) commit 920a3df71b03d7d6864b162cb460439d20d31a1d Author: Will Soula Date: Tue Feb 12 07:40:45 2013 -0600 Fixing trigger-parameterized-builds example The example for the trigger-parameterized-builds functionality is incorrect. A dash is needed before the project in the yaml so the code knows that project is used multiple times. I also added the predefined-parameters value to the example to show how that is used, because it took me a while to figure out Change-Id: Ib6c5ffb18c213ccc1396edd1264edbf4c28ff651 Reviewed-on: https://review.openstack.org/21129 Reviewed-by: Clark Boylan Reviewed-by: Khai Do Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 4cc4634612dc5e67026c8d7f918a7b5d1c894a26 Author: Will Soula Date: Mon Jan 28 09:31:58 2013 -0600 Adding extended-choice functionality This change adds the ability to use the extended choice plugin. This plugin allows you to populate a file with choices and then allow the user to select one or more when the build now button is clicked. This change only changes the properties and setup files. Change-Id: I05af63f75f9ab87cd923c23177d33898c26149cf Reviewed-on: https://review.openstack.org/20610 Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Reviewed-by: Khai Do Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/properties.py | 75 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 76 insertions(+) commit f05ed7c0aeb59b6a67835703dcb013ba61e04010 Author: Timo Tijhof Date: Wed Feb 13 21:17:42 2013 +0100 Gitignore: Add /etc/jenkins_jobs.ini and output/ directory. Change-Id: I358b0a05a2a1a9936f30eef3e77b555eff1044ec Reviewed-on: https://review.openstack.org/21908 Reviewed-by: Khai Do Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins .gitignore | 2 ++ 1 file changed, 2 insertions(+) commit 793a1fcdccdca52f6b82603d089f9d2122d1956a Author: Timo Tijhof Date: Sat Feb 2 19:41:16 2013 -0800 Implement publisher.checkstyle Add publisher for Checkstyle Plugin[1] (based on code for the Violations Plugin publisher) [1] https://wiki.jenkins-ci.org/display/JENKINS/Checkstyle+Plugin Change-Id: Ie622ad8600720081072f288e72dd56e65505380a Reviewed-on: https://review.openstack.org/21066 Reviewed-by: Monty Taylor Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 143 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 144 insertions(+) commit 033d78bcc22048376e851ee0933a61886c8a509d Author: Lukas Bednar Date: Thu Jan 24 19:46:47 2013 +0100 publishers: added option to define groovy postbuild script Change-Id: I3ee3be40148321412c04bfa2c72152bc41986389 Reviewed-on: https://review.openstack.org/20905 Reviewed-by: Jaroslav Henner Reviewed-by: Monty Taylor Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 20 ++++++++++++++++++++ setup.py | 2 ++ 2 files changed, 22 insertions(+) commit 8e9d536384cafd1a23d000357e2d363934e0586a Author: Will Soula Date: Wed Jan 2 11:23:42 2013 -0600 Fixing Inject to not create empty tags Using the Inject functionality with the builders section caused an error in Jenkins because the script-file was blank but the tag existed in the xml. Fixing this by adding a function to create the XML only if the given value is not None and not a blank value '': def add_nonblank_xml_subelement(parent, tag, value): Change-Id: I9151f7444f6807e929721b04fb8e7ad3a867cd6c Reviewed-on: https://review.openstack.org/18820 Reviewed-by: Jon-Paul Sullivan Reviewed-by: Tollef Fog Heen Reviewed-by: Jeremy Stanley Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/base.py | 10 ++++++++++ jenkins_jobs/modules/builders.py | 10 +++++----- jenkins_jobs/modules/properties.py | 22 ++++++++++++---------- jenkins_jobs/modules/wrappers.py | 24 ++++++++++++------------ 4 files changed, 39 insertions(+), 27 deletions(-) commit efa1ddf0c3283a6d6353e78433549e0f2eee3dab Author: Jon-Paul Sullivan Date: Fri Jan 25 11:13:00 2013 +0000 Bugfix and tidy-up Allow the configuration file to be optional for test mode Tidy-up the hipchat notifier module - Require a valid hipchat authtoken Ignore temporary vi/vim files in .gitignore Add extra debugging output - write out cache file to enable easy removal to force upload - clearly notify that no changes are seen so uploading not occurring Change-Id: Ia418704b76090e284e0b801609f2f05bfa06b9ae Reviewed-on: https://review.openstack.org/20380 Reviewed-by: Jeremy Stanley Reviewed-by: Khai Do Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins .gitignore | 1 + jenkins_jobs/builder.py | 3 +++ jenkins_jobs/cmd.py | 10 ++++++++-- jenkins_jobs/modules/hipchat_notif.py | 22 +++++++++++++--------- 4 files changed, 25 insertions(+), 11 deletions(-) commit fcb82e93eab19174c13a689b12d24dfd4ae81bdc Author: Tollef Fog Heen Date: Wed Jan 23 13:12:35 2013 +0100 Raise exception for at least one type of syntax errors Every so often, I create a yaml file with something like: - job: name: "test" This previously exploded with an obscure error message, now it raises an exception with a hopefully less obscure error. Change-Id: Ie9e402a9ec5afa8dac069a6cae5710eabbc0e665 Signed-off-by: Tollef Fog Heen Reviewed-on: https://review.openstack.org/20322 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Reviewed-by: Jeremy Stanley Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/builder.py | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 6cbb416e2096796b03a4cbcf79a41913e8f4d515 Author: James E. Blair Date: Wed Jan 16 18:07:14 2013 -0800 Remove setuptools-git from setup.py. Put it in test-requires so it's there when we build a tarball. Change-Id: I8a5adec74beeb397e71e17030338a8051fe6fb0b Reviewed-on: https://review.openstack.org/19885 Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Approved: Clark Boylan Tested-by: Jenkins setup.py | 1 - tools/test-requires | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) commit 656915f66d159f0e2ff3ba7846d87604e6a793ef Author: Paul Belanger Date: Wed Jan 16 22:18:27 2013 -0500 Documentation fixes to make Sphinx happy On this note, we have an issue with our current gate test for documentation not properly catching these issues. I'll be attempting to address the issue in a future patch. Change-Id: I7d0bea70ef98d1744200815ce12f1436729349e8 Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/19889 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 2 ++ doc/source/general.rst | 4 ++-- jenkins_jobs/modules/wrappers.py | 22 ++++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) commit ff734c72dc0e6dc40614c8ffcc60dffb85d6deac Author: Clark Boylan Date: Tue Jan 15 15:22:28 2013 -0800 Add ability to specify mavenName for maven jobs. Previously maven jobs did not specify a maven name so which maven install Jenkins treated as default was used for all JJB maven jobs. Add the ability to set a maven install explicitly so that multiple maven installs may be used. Change-Id: I6a26635c31c5504b855063e1d4f6fa53132f26b5 Reviewed-on: https://review.openstack.org/19756 Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/project_maven.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit a11016979d7f153bb319a2455548ebb731803604 Author: Antoine Musso Date: Fri Nov 16 20:27:16 2012 +0100 sphinx is now stricter The documentation files often have minor typo or badly formatted commands which makes sphinx emits a warning. To make sure we always catch them via the Jenkins build, this patch makes sphinx to convert warning to errors thus aborting the build, simply add to pass the -W option to sphinx-build. This patch also fix one warning: * There is no source/_static dir so disable html_static_path Test plan: $ make clean; make html rm -rf build/* sphinx-build -b html -d build/doctrees -W source build/html Making output directory... Running Sphinx v1.1.3 loading pickled environment... not yet created building [html]: targets for 18 source files that are out of date updating environment: 18 added, 0 changed, 0 removed reading sources... [100%] zuul looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] zuul writing additional files... genindex py-modindex search copying static files... done dumping search index... done dumping object inventory... done build succeeded. Build finished. The HTML pages are in build/html. $ Change-Id: I55935fb5e869919ac639f841876aaf3871c71d17 Reviewed-on: https://review.openstack.org/16328 Reviewed-by: Paul Belanger Reviewed-by: Monty Taylor Reviewed-by: Jeremy Stanley Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins doc/Makefile | 2 +- doc/source/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit fb582ad2dc4ca2f0011ea325b6dfda64dbd0d7a6 Author: Will Soula Date: Thu Jan 10 08:24:19 2013 -0600 Fixing defaults for email-ext If you go into Jenkins and just fill out the reipient list and click save, Jenkins will default to having a Failure Trigger. Jenkins will also set the subject to $DEFAULT_SUBJECT and the content to $DEFAULT_CONTENT. This change is making JJB have the same defaults for the email-ext functionality. This way a user can just set the recipient list and have it show up in Jenkins. Previously just setting the reipient list lead to $DEFAULT_RECIPIENTS being set instead with a FailureTrigger and this can be confusing to some users. This change also makes the recipient list default to $DEFAULT_RECIPIENTS, like the plugin does when you first add it to a job. This way a user can just specify email-ext and the global defaults will be used. Change-Id: I8f207d495466a4a87431dbcb2cd46cb661b60ce1 Reviewed-on: https://review.openstack.org/19391 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) commit 059a6b52fc21c04df4df698b00b0fb041b6cbea8 Author: Will Soula Date: Thu Jan 10 07:24:26 2013 -0600 Adding ability to use batch commands This change adds the ability to run arbitrary batch commands. This functionality is to be able to run windows commands on a windows slave or master. The format followed is exactly the same as the shell functionality. Change-Id: I463660b29b09e5945137b50b3721ee04cc5fc04c Reviewed-on: https://review.openstack.org/19387 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 16 ++++++++++++++++ setup.py | 1 + 2 files changed, 17 insertions(+) commit ca613f9e5c7dfad1edf688571f6a2ba1a6e29533 Author: Will Soula Date: Wed Jan 2 10:20:58 2013 -0600 Adding new options to git checkout A new option has been added to git checkout called name that specifies the name to fetch. Also added the ability to specify the git tool to use by specifying git-tool: Default Change-Id: Ie985c39fb5c6dc6ad84ee97bfb203da9fd689b8c Reviewed-on: https://review.openstack.org/18817 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/scm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit ec28b325eea1e615f5e2cd1f02b2e6df56c53b2c Author: Will Soula Date: Thu Dec 27 11:26:20 2012 -0600 Fixing function name to follow standards The current style guide is for functions implemented as xx-xx to be named xx_xx in the python code. The functionality implementing the claim build plugin has been implemented as claim-build, thus the function in the python code should be claim_build instead of claimbuild as it is currently implemented Change-Id: I0cc3ebe37bfd6249f2985f0208697d6cc1a275db Reviewed-on: https://review.openstack.org/18688 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 54c26d4347187fe3539e6ed1f65b030b60148e5f Author: Will Soula Date: Mon Dec 31 11:54:56 2012 -0600 Fixing capitalization of SubElement in wrappers.py The locks function was broken due to a mis-capitalization It was XML.Subelement and I changed it to XML.SubElement The locks functionality now works correctly Change-Id: Icebcad27515eebce9609262e0f9f3d5c87acb19f Reviewed-on: https://review.openstack.org/18687 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5a1ecbdaa3bc5b41690c1d6bb283ea7ef529ef4d Author: Will Soula Date: Mon Dec 31 13:18:08 2012 -0600 Doc consistency between help and confirm text The delete-all command's help text did not match the confirm text for the delete-all command. The help now matches the confirm text and is gramatically correct Change-Id: If9c37958192dbdd2de61e74fe95aad2d8a170ca3 Reviewed-on: https://review.openstack.org/18685 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 86549db32f22f260ea61c2dc24e5f4988bf550fd Author: K Jonathan Harker Date: Mon Dec 10 20:03:44 2012 -0800 Add a jclouds wrapper. Note: this does not take care of the initial configuration of jenkins to use jclouds, it merely lets you create jobs from manually-configured jclouds templates. Change-Id: I981bd90fffb0077bf8f60c8701a157ebd8009000 Reviewed-on: https://review.openstack.org/17826 Reviewed-by: Monty Taylor Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 49 ++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 50 insertions(+) commit 8a0e034d2642e9498e633016ffceafeaa1a4d9f5 Author: Julian Taylor Date: Thu Dec 13 19:08:34 2012 +0100 add category support to throttle configuration Change-Id: I9ca58ed9d7513b2223632a7173a229571a08a535 Reviewed-on: https://review.openstack.org/18059 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/properties.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit eb210845e43bd8a788f4f604721d23b4722c3032 Author: william.soula Date: Tue Nov 27 10:23:10 2012 -0600 Adding ability to specify the JDK to use. This change moves the top level config from builder.py into a separate file called general.py. This change also moves the assigned node work as well as the log rotator work into the general.py file. This change also adds the ability to specify the JDK for the build to use. Change-Id: I0e2b43d889593e01d6ad0761960c93472990af1e Reviewed-on: https://review.openstack.org/16983 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins doc/source/general.rst | 57 ++++++++++++++++++-- jenkins_jobs/builder.py | 27 ---------- jenkins_jobs/modules/assignednode.py | 42 --------------- jenkins_jobs/modules/general.py | 97 ++++++++++++++++++++++++++++++++++ jenkins_jobs/modules/logrotate.py | 51 ------------------ setup.py | 3 +- tools/run-compare-xml.sh | 6 +-- 7 files changed, 155 insertions(+), 128 deletions(-) commit 899ab4a98070ba9e4c0a8e891e9d73fd6e05437d Author: Monty Taylor Date: Sun Dec 16 10:41:03 2012 -0800 Updated .gitreview location Change-Id: I34f83ea4152fd7f845b6d3402863997da2661a8a Reviewed-on: https://review.openstack.org/18184 Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins .gitreview | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e3a72b30342a5ae2b9de214ca9a0c4e04546d504 Author: Jeremy Stanley Date: Sun Dec 16 18:48:11 2012 +0000 Update README for project move. * README.rst: Correct clone URL. Change-Id: I830e3bfbca6c537dce78449110b1c6d444a0574b Reviewed-on: https://review.openstack.org/18199 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d1aad43f1ea85595f6b320c0a291e12ea9507759 Author: James E. Blair Date: Sun Dec 16 11:46:54 2012 -0800 Add ZUUL_REF parameter to zuul post jobs. Change-Id: If557503638cd688b977fbfe27ce7fdfd0a77cce4 Reviewed-on: https://review.openstack.org/18202 Tested-by: Jenkins Reviewed-by: Monty Taylor Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: James E. Blair jenkins_jobs/modules/zuul.py | 3 +++ 1 file changed, 3 insertions(+) commit e5ad38a3dde90913dbeb2023662ab387d6620d60 Author: Antoine Musso Date: Wed Dec 12 15:04:29 2012 +0100 document parameter usage of Macros This patch update the 'configuration' documentation related to Macros. It shows up how to: - write a parameterized macro - write a specialized macro reusing the code from a parameterized macro (parameters are hardcoded) - a common culprit which is to call a parameterized macro but forgetting to pass the parameter. Change-Id: I8a58ab514ea572b977ebc528e848b6cf44c6dc7d Reviewed-on: https://review.openstack.org/17937 Reviewed-by: Tollef Fog Heen Reviewed-by: Jeremy Stanley Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) commit f511f5fc114d6569f3d43e53421912743bacff32 Author: Antoine Musso Date: Tue Dec 4 11:43:05 2012 +0100 ant can now be passed properties The Ant plugin let us fill in a set of properties one by line using the format key=value. This patch mimic that feature. Given the YAML input: - job: name: "basic-ant-test" builders: - ant: targets: "debug test install" properties: key1: value1 key2: value2 The builders section in the resulting Jenkins XML will be: debug test install key2=value2 key1=value1 default Change-Id: I1bf245319c1009be824d3a57d3e74e750a76414d Reviewed-on: https://review.openstack.org/17451 Reviewed-by: James E. Blair Reviewed-by: Tollef Fog Heen Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit ac4bcc40708c687f01131cd1b9c8d0782040a12d Author: Julian Taylor Date: Sat Nov 24 12:42:23 2012 +0100 add matrix job support currently only supports label expression axes Change-Id: I5d714affdf101eeb5b0eeae5ed5408d6964c6b77 Reviewed-on: https://review.openstack.org/16908 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 1 + doc/source/project_matrix.rst | 7 ++ jenkins_jobs/modules/builders.py | 2 +- jenkins_jobs/modules/project_matrix.py | 112 ++++++++++++++++++++++++++++++++ setup.py | 1 + 5 files changed, 122 insertions(+), 1 deletion(-) commit 99765cc46877cb84e1c11dfdf2b354c82b4544d1 Author: James E. Blair Date: Tue Dec 4 16:02:26 2012 -0800 Add option to specify Zuul URL. This is needed in order to run Zuul on a server other than the Jenkins master. This isn't a great design, but it is minimally invasive to JJB while we work on improving Zuul to remove the need for parameter specification and notifications. Change-Id: Ib4dabfc3fe37623031bdbe4a8ec53f25a6070a8e Reviewed-on: https://review.openstack.org/17517 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/zuul.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) commit 84c32a232fa83101215d6c99485838c028610eed Author: william.soula Date: Thu Nov 22 18:01:21 2012 -0600 Adding ablity to use the Env Inject Plugin with the Build Environment section. This adds the third place the Env Inject Plugin can be used Change-Id: Ic468e265c606b20e7684da8092194c21f6135bef Reviewed-on: https://review.openstack.org/16923 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 32 ++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 33 insertions(+) commit c3c666d2cf5a903a7045cbf3774a7fed0d6197a3 Author: william.soula Date: Thu Nov 22 16:42:21 2012 -0600 Adding ability to specify the scm browser Change-Id: I120449433845c4bf50a546fbdb0c144d7741f5e9 Reviewed-on: https://review.openstack.org/16916 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/scm.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit 5bb08b5fdb4798a91b1670f05a191130a12ed524 Author: william.soula Date: Fri Nov 23 10:06:43 2012 -0600 Add ability to use the JIRA Plugin. This change adds the ability for Jenkins to update relevant JIRA issues Change-Id: I1fdf00feb6931e588af587924a6a995fd66c2490 Reviewed-on: https://review.openstack.org/16971 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 14 ++++++++++++++ setup.py | 1 + 2 files changed, 15 insertions(+) commit e23d23906bbb92b3671a6bfc80378b5efec22506 Author: Julian Taylor Date: Wed Nov 21 19:44:23 2012 +0100 use the xdg cache directory for the job cache this places the cache file in $XDG_CACHE_HOME/jenkins_jobs/ instead of $HOME/ the xdg cache home is defined as ~/.cache/ if $XDG_CACHE_HOME is unset Existing files are not moved automatically. Change-Id: I0937346b08ba8d199422aea4043ebad087d92cca Reviewed-on: https://review.openstack.org/16665 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit 7bcc38c3c634d385871681f1c956e2571c5e7825 Author: Julian Taylor Date: Tue Nov 20 18:10:40 2012 +0100 add support for copy-to-slave and copy-to-master Change-Id: I53eda0c9061cd3cc6c17f9f0afb1cb0bc60d9202 Reviewed-on: https://review.openstack.org/16550 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 35 ++++++++++++++++++++++++++++ jenkins_jobs/modules/wrappers.py | 44 ++++++++++++++++++++++++++++++++++++ setup.py | 2 ++ 3 files changed, 81 insertions(+) commit 2f4a0c11a9d59d2b9530f51bb0f108912343306a Author: Julian Taylor Date: Tue Nov 20 18:08:35 2012 +0100 add support for logparser publisher Change-Id: If52f021fd077ffd5983cda8c672ce93d1084097d Reviewed-on: https://review.openstack.org/16549 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 27 +++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 28 insertions(+) commit 47206008ac4256672e6fbb5463553d4b3d41a05e Author: william.soula Date: Thu Nov 22 14:45:05 2012 -0600 Adding ability to use the Gradle plugin Change-Id: Ia8ca38290fbc04d24628dc30862823df628ada0a Reviewed-on: https://review.openstack.org/16906 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 32 ++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 33 insertions(+) commit 51b0928d0cee48e96ad8ab84b31e85afef2fab1e Author: Julian Taylor Date: Tue Nov 20 18:04:43 2012 +0100 add support for cppcheck result publisher Change-Id: Iaa0fefb296c72ce4ac955986375e63704f45e6d5 Reviewed-on: https://review.openstack.org/16548 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 86 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 87 insertions(+) commit 1a8a68255bef1280cee2f4ba0c663aa1a918c65b Author: Antoine Musso Date: Sun Nov 25 20:59:44 2012 +0100 git 'basedir' specify destination directory The Jenkins Git plugin let us specify a directory to clone too instead of simply workspace. This patch adds to the git scm module a 'basedir' parameter just like the svn scm module. Change-Id: I385171009e0a2114c92f555796a4c03a3b98cf76 Reviewed-on: https://review.openstack.org/16849 Reviewed-by: Paul Belanger Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/scm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c53f679755adce2784320afd68fd378a15979b52 Author: Antoine Musso Date: Tue Nov 20 14:48:43 2012 +0100 should always be inserted in jobs In some rare occasions, one might want to set up a job template that would not have any "builders:" section. In such a case Jenkins Job Builder would generate a Jenkins XML configuration file missing the XML element. This cause Jenkins 1.472 to emit a null pointer exception and to ignore the job. This patch track whether we are have been provided a 'builders:' instruction from the YAML file. If none has been provided, craft an empty XML element to make Jenkins happy. Change-Id: I4dcae110d127c754532cdf436835b25c147117f3 Reviewed-on: https://review.openstack.org/16527 Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 7 +++++++ 1 file changed, 7 insertions(+) commit 345fb6e5e11934ce87e45b86411b1f86634eb223 Author: Paul Belanger Date: Tue Nov 20 22:06:37 2012 -0500 Bump pep8 to 1.3.3 However due to an upstream bug[1] we ignore E125 for now. [1] https://github.com/jcrocholl/pep8/issues/126 Change-Id: I75337d9194156580cc66666aed9a5bc2fd5d4e15 Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/16604 Reviewed-by: Jeremy Stanley Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/builder.py | 10 +- jenkins_jobs/cmd.py | 13 +-- jenkins_jobs/modules/builders.py | 32 +++--- jenkins_jobs/modules/hipchat_notif.py | 11 +- jenkins_jobs/modules/notifications.py | 7 +- jenkins_jobs/modules/parameters.py | 10 +- jenkins_jobs/modules/properties.py | 17 +-- jenkins_jobs/modules/publishers.py | 93 ++++++++-------- jenkins_jobs/modules/scm.py | 10 +- jenkins_jobs/modules/wrappers.py | 22 ++-- jenkins_jobs/modules/zuul.py | 116 ++++++++++---------- setup.py | 187 +++++++++++++++++---------------- tox.ini | 4 +- 13 files changed, 282 insertions(+), 250 deletions(-) commit 9a4ad66bb8a4fbe9d94f77293707ccdf5516a8c4 Author: Ghe Rivero Date: Wed Nov 21 09:37:19 2012 +0100 Small doc fixes - A couple of typos - Avoid .yaml to be interpreted as manpage macro Change-Id: I51f954da733cef64b05fee9797b01afba41d48f3 Reviewed-on: https://review.openstack.org/16613 Reviewed-by: Paul Belanger Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins doc/source/configuration.rst | 6 +++--- jenkins_jobs/modules/builders.py | 2 +- jenkins_jobs/modules/publishers.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) commit c6bae32bd974f4edf9c14782a757948f14aabc51 Author: Paul Belanger Date: Tue Nov 20 13:16:16 2012 -0500 Update man_pages name to jenkins-jobs This is mostly for our packaging efforts, and now will allow a user to do: $ man jenkins-jobs to access the documention. Change-Id: Ie9fe43021dd5c5c8cd9fe07e457fb7d8db45f083 Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/16555 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 684f17a98e84b6f8d10b2c236fce27ad52d52e8a Author: Antoine Musso Date: Tue Nov 20 09:51:43 2012 +0100 xunit publisher update for The xunit Jenkins plugin has changed an XML element name between its versions 1.48 and 1.51. This patch update JJB publisher to reflect that change. The element used to be and is now . Change-Id: Ia1b77da6f449e198ff4e4843a7f0041e4b001703 Reviewed-on: https://review.openstack.org/16519 Reviewed-by: David Ripton Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 329633da6df4a8e619d4fd4d896ff09371d2172f Author: Paul Belanger Date: Mon Nov 19 17:39:28 2012 -0500 Convert our README to ReStructuredText This should make pypi.python.org happier! Change-Id: I2e82bf8cb81545831bdb864b049d01e3faffabb9 Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/16486 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins README.md | 58 ------------------------------------------------- README.rst | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 58 deletions(-) commit 0b9691ea02b8049afbe2f3c81124e91e4b6a4040 Author: Paul Belanger Date: Tue Nov 20 11:46:32 2012 -0500 Update tox to exclude *egg for pep8 I'm looking at you setuptool-git Change-Id: I0b40bc2d902b056085567b7ac740fefd9f5950f0 Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/16545 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins .gitignore | 2 ++ tox.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) commit 7f7cac2cd54b459441338d40745cf6b3a25f118b Author: Monty Taylor Date: Mon Nov 19 15:42:45 2012 -0800 Just give in and use setuptools_git. Change-Id: Id0bc211c8071e66379f0eccf0a06118a7245f0de Reviewed-on: https://review.openstack.org/16495 Reviewed-by: James E. Blair Reviewed-by: Paul Belanger Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins MANIFEST.in | 15 ++++++--------- setup.py | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) commit b3e5247bf0aa8836df760b1c2916061be19b5522 Author: Julian Taylor Date: Mon Nov 19 20:02:40 2012 +0100 Add copyartifact builder to entry points and fix target attribute Fixes bug #1080824 Change-Id: Ie5043283bf8c0f13f04d250c4c7299596d766508 Reviewed-on: https://review.openstack.org/16454 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/builders.py | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit e4adf8fbcf79bd91db8516d26c904edfeaf07249 Author: Monty Taylor Date: Sat Nov 10 15:42:17 2012 -0800 Use console_scripts entrypoint. Since the project uses entrypoints so heavily - move the jenkins-jobs script to be contained within the project and have entrypoints generate the script. Change-Id: Ie9541163c8677de1b05576491c8e9e63d3bd25fc Reviewed-on: https://review.openstack.org/15816 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins-jobs | 85 --------------------------------------------------- jenkins_jobs/cmd.py | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 4 ++- tox.ini | 6 ++-- 4 files changed, 91 insertions(+), 89 deletions(-) commit 863d0a01d540c521b2ee385cf21688234dfb6311 Author: Clark Boylan Date: Fri Nov 16 13:49:24 2012 -0800 Add option to block up|down stream builds. Jenkins has advanced project options that allow you to block if the up or down stream projects are currently being built. Support these options through JJB. Change-Id: I8cfe3e19d1d929517c0a6ee886b31241b3e9b588 Reviewed-on: https://review.openstack.org/16338 Reviewed-by: Antoine Musso Reviewed-by: James E. Blair Reviewed-by: Paul Belanger Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins doc/source/configuration.rst | 27 +++++++++++++++++++++++++++ jenkins_jobs/builder.py | 14 ++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) commit bb507da792772270e2839b4d64ee038c4b7e6843 Author: Antoine Musso Date: Tue Nov 13 21:16:23 2012 +0100 git scm learned 'refspec' parameter The Zuul configuration advise user to set the Git plugin ref specifier to $ZUUL_REF which was not supported. This patch let you specify it using: scm: - git: refspec: '$ZUUL_REF' Will fallback, as before, to '+refs/heads/*:refs/remotes/origin/*' Change-Id: I1db7e86f8be5f6b167ba99f8fec266b4e8ff95a8 Reviewed-on: https://review.openstack.org/16011 Reviewed-by: James E. Blair Reviewed-by: Paul Belanger Reviewed-by: Jeremy Stanley Approved: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/scm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 8dd11dc1dea98806f622a7391acb3c96799c463c Author: Antoine Musso Date: Tue Nov 13 21:11:27 2012 +0100 Provide ZUUL_COMMIT to zuul triggered job Zuul documentation advise user to configure their Jenkins GIT plugin with ZUUL_COMMIT as a branch specifier although it is not sent! http://ci.openstack.org/zuul/launchers.html#jenkins Change-Id: I2147e1b2d54a7101d6b7324c1e553f46dcdb4bb7 Reviewed-on: https://review.openstack.org/16010 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/zuul.py | 3 +++ 1 file changed, 3 insertions(+) commit 3d4fb02986461d459f998d1e0198d9b0adc43686 Author: Antoine Musso Date: Thu Nov 15 13:27:42 2012 +0100 jenkins user must have global read permission Change-Id: I467f2b8ca5fcffc118c1bdc3d5dee04c309ac70f Reviewed-on: https://review.openstack.org/16170 Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins doc/source/installation.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 06be036fda8b2975b12a83a0b6930a2fa8a8fb5f Author: Antoine Musso Date: Thu Nov 15 13:12:14 2012 +0100 trivial whitespace errors in Sphinx jenkins_jobs/modules/builders.py:docstring of builders.artifact_resolver:3: WARNING: Definition list ends without a blank line; unexpected unindent. jenkins_jobs/modules/wrappers.py:docstring of wrappers.build_name:6: WARNING: Field list ends without a blank line; unexpected unindent. Change-Id: Iff77f346172e1c45a035e112e22e8e2fda9933e3 Reviewed-on: https://review.openstack.org/16169 Reviewed-by: Paul Belanger Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/builders.py | 2 +- jenkins_jobs/modules/wrappers.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) commit 2c8ba72e2786bb7fa57291e0d5a709f67367f6cd Author: Antoine Musso Date: Sat Nov 10 16:41:49 2012 +0100 zuul trigger now also adds ZUUL_UUID parameter The UUID parameter has been deprecated in Zuul in favor of ZUUL_UUID, see "upstream" commit: - https://review.openstack.org/#/c/13934/ - I88c38a28dcd552b2540095d36caacd10acf167b8 Change-Id: I938e4059e435d8ffd5eef73dc0affed71463ba45 Reviewed-on: https://review.openstack.org/15813 Reviewed-by: Clark Boylan Reviewed-by: James E. Blair Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins jenkins_jobs/modules/zuul.py | 8 ++++++++ 1 file changed, 8 insertions(+) commit b916c29d469f45c62b54a1956bed46b0107314d9 Author: Jeremy Stanley Date: Wed Nov 14 13:34:51 2012 +0000 Add a LICENSE file. * LICENSE: This file was referenced in MANIFEST.in but did not actually exist in the repository. It has been taken from Apache's published copy of their Apache Software License 2.0, with appendix included. Change-Id: I1ab3a257f3bf1df929aac3acd9184c9c262a614b Reviewed-on: https://review.openstack.org/16071 Reviewed-by: Paul Belanger Reviewed-by: James E. Blair Reviewed-by: Tollef Fog Heen Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) commit 70c2536ba67d364f3a920b3657767fe0738087ab Author: william.soula Date: Sat Nov 10 17:41:53 2012 -0600 Adding ability to use the Repository Connector Plugin Change-Id: I4602154fa7fca84d1eaa6aed13e501fcc770b609 Reviewed-on: https://review.openstack.org/15926 Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/builders.py | 67 ++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 68 insertions(+) commit 7d319fc9b902d5948b5ed1f25b68f90477ed57f7 Author: william.soula Date: Sat Nov 10 12:18:25 2012 -0600 Adding ability to use the Locks and Latches plugin Change-Id: I8c63de4eebd42dbe2274a560b038ffe3f7cf8598 Reviewed-on: https://review.openstack.org/15891 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 25 +++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 26 insertions(+) commit a28c629cf12a99ab2f2f55b86e4c6b13c5c88a63 Author: Paul Belanger Date: Sun Nov 11 13:36:35 2012 -0500 Add etc folder to manifest Change-Id: I9752eb85ff640a5b32fb2940c7a54f80cf3762a1 Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/15835 Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins MANIFEST.in | 1 + 1 file changed, 1 insertion(+) commit 95cafc8bb0ed7a921c993b0d03e16e009c8659f5 Author: Paul Belanger Date: Sat Nov 3 14:09:50 2012 -0400 Add openstack-common support for setup and version With help from clarkb in #openstack-infra and openstack-ci/gerritbot, I've manage to update our versioning to be inline with other openstack projects. This is another step towards creating our OS packaging. Change-Id: If3f44b939ee0a3c9c4dfa1d9f83ae14a8285ba5f Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/15335 Reviewed-by: Jeremy Stanley Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins .gitignore | 14 +- MANIFEST.in | 10 + doc/source/conf.py | 7 +- jenkins_jobs/openstack/common/setup.py | 362 ++++++++++++++++++++++++++++++ jenkins_jobs/openstack/common/version.py | 148 ++++++++++++ jenkins_jobs/sphinx/yaml.py | 2 +- jenkins_jobs/version.py | 20 ++ openstack-common.conf | 7 + setup.cfg | 1 - setup.py | 224 +++++++++--------- 10 files changed, 682 insertions(+), 113 deletions(-) commit a7b7b8a30ce1383f5a9a52103344ba8b5544a12a Author: william.soula Date: Wed Nov 7 19:36:22 2012 -0600 Adding ability to block build till triggered builds complete Change-Id: Ia5c386e664e52b0be568b46abeb0491c512442c3 Reviewed-on: https://review.openstack.org/15734 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit 46c78640e0faecfe75ec2a10aed3e7ab2dfce658 Author: william.soula Date: Mon Nov 5 06:46:09 2012 -0600 Adding ability to aggregate downstream test results Change-Id: If688379d17cf1cbfaf4018f53e0e01625ddaeb11 Reviewed-on: https://review.openstack.org/15522 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 18 ++++++++++++++++++ setup.py | 1 + 2 files changed, 19 insertions(+) commit 88d5d405fdac6263bbf5b6a4cd86b3f58db9ebd5 Author: william.soula Date: Tue Nov 6 21:02:30 2012 -0600 Adding ability to use the Port Allocator Plugin Change-Id: Ie64b4d3d0b1812347f6cc5921dc1cb5bb22ea27f Reviewed-on: https://review.openstack.org/15402 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 22 ++++++++++++++++++++++ setup.py | 1 + 2 files changed, 23 insertions(+) commit 3cbe673615c06d959949bf5a12ca05fdfdc93e49 Author: william.soula Date: Mon Nov 5 04:32:31 2012 -0600 Adding ability to fingerprint files Change-Id: If5f59588994ad17de56adffa0f64a1aab1ee2e1c Reviewed-on: https://review.openstack.org/15514 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 22 ++++++++++++++++++++++ setup.py | 1 + 2 files changed, 23 insertions(+) commit d332f499afde8311b550e2714d1c5c0b3b1b5c28 Author: william.soula Date: Mon Nov 5 08:15:47 2012 -0600 Adding ability to checkout multiple svn repositories Change-Id: I5f07fe15dfed1f65a8793bdf68805b0ec6b16bc7 Reviewed-on: https://review.openstack.org/15527 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/scm.py | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) commit 2dbd8690d81f44f2b44cfa96efbf089afc5ee831 Author: william.soula Date: Sun Nov 4 07:39:59 2012 -0600 Adding ability to use the Email-ext plugin Change-Id: I3b4094397726eb0ddd0acc019e19ffa96251a9e1 Reviewed-on: https://review.openstack.org/15438 Reviewed-by: Tollef Fog Heen Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 97 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 98 insertions(+) commit d932233e27e6f6cbc113849dda40ea6d28a1cc5e Author: william.soula Date: Sun Nov 4 06:45:10 2012 -0600 Adding ability to specify the ant installation to use Change-Id: I3edb57a98bb7aa0d488118abdc892793d47e43f9 Reviewed-on: https://review.openstack.org/15407 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 7 +++++++ 1 file changed, 7 insertions(+) commit 64b2fb4936100ce3e172cd7d0114e481cadf4cb8 Author: Tollef Fog Heen Date: Mon Nov 5 13:30:33 2012 +0100 Fix up example syntax in triggers.py Change-Id: I63756ecd50d6cf03455998ba40b4c63563793388 Reviewed-on: https://review.openstack.org/15392 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 5c54ba0e6460b8c5c5140a21f147e657c7c32f60 Author: Tollef Fog Heen Date: Thu Nov 1 14:49:22 2012 +0100 Expose more options for the git scm handler Change-Id: Idd074a184c18bb21c3864d1508c6cb3708f07d9d Reviewed-on: https://review.openstack.org/15198 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/scm.py | 70 ++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 21 deletions(-) commit 95cdc4a2c288dbd009427631d8106a6616824037 Author: Tollef Fog Heen Date: Tue Oct 30 13:43:53 2012 +0100 Add pre-build support for the workspace cleanup plugin Change-Id: Ib88d09a2da1c903bac9afeb1dbd70648e003edfe Reviewed-on: https://review.openstack.org/15024 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 38 ++++++++++++++++++++++++++++++++++++++ setup.py | 2 ++ 2 files changed, 40 insertions(+) commit ff2f3f7505f81efaaa8b9ccf61a6008a7172132b Author: Tollef Fog Heen Date: Thu Nov 1 11:03:16 2012 +0100 Fix up description of text_param and file_param Change-Id: Ief99fab872a531402c0907b4f44defce37d249e1 Reviewed-on: https://review.openstack.org/15189 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/parameters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e0692e65cec2ffcf8f8b88f8ec188696ee46937f Author: william.soula Date: Mon Oct 29 23:13:43 2012 -0500 Adding ability to use the Build Name Setter Plugin Change-Id: Icf933a25513f3b349ef67badc7b3e9cd7998089c Reviewed-on: https://review.openstack.org/15037 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 20 ++++++++++++++++++++ setup.py | 1 + 2 files changed, 21 insertions(+) commit 1c6c180945eaf8d9efaca5eb0aba8f83c89e3bf1 Author: James E. Blair Date: Tue Oct 30 18:03:42 2012 +0100 Add some style developer docs. Change-Id: I0610218034ea6c3aeeee03ab9b14ca79d25c5810 Reviewed-on: https://review.openstack.org/15046 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) commit e1689c112fefa62daff1cb7ec7384847593ab9b1 Author: Tollef Fog Heen Date: Tue Oct 30 12:18:27 2012 +0100 Add support for full authorization matrices Change-Id: I387ea1d006f3d1a053cb7e88afc9fe99ea010a5c Reviewed-on: https://review.openstack.org/15021 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/properties.py | 60 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 61 insertions(+) commit f2e3b038ffd5fd5f33d61178524b9790e5abfe77 Author: Tollef Fog Heen Date: Tue Oct 30 08:46:05 2012 +0100 Fix up examples so they're at least syntactically valid Ideally we should verify this at build time, but until then, at least make the examples syntactically valid for anybody trying to get started. Change-Id: I413ae9576b012a4847bedaa5a1582fad3e1a8de0 Reviewed-on: https://review.openstack.org/15018 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 56 ++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 29 deletions(-) commit 5d3d6ea8c1239bc0399f5f858d90a18ebce69edd Author: william.soula Date: Mon Oct 29 22:18:18 2012 -0500 Adding ability to use the EnvInject Plugin Change-Id: I619393f1f6144e8ee48d7642f2ff97f34b4d18dc Reviewed-on: https://review.openstack.org/15029 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 24 ++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 25 insertions(+) commit e7d815df23060847b0fb0d9d0a9cf557dff936e6 Author: Manuel Desbonnet Date: Tue Oct 23 15:33:02 2012 +0100 Changing parameter order for 'trigger-builds' builder. It seems that order is important for the various parameter options that can be passed to the envinject parameterized trigger plugin. The relative order (of XML generation) of the 'current-parameters' option has been changed so that it is generated before any 'predefined-parameters'. This allows for overriding any of the current parameters with a pre-defined parameter. Change-Id: If0429a63267b314c23e0ef331546e3187b4373c3 Reviewed-on: https://review.openstack.org/15050 Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/builders.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit e81b5a564656b73a660eea56911866c3098e6da3 Author: Paul Belanger Date: Tue Oct 30 11:46:40 2012 -0400 Add sample jenkins_jobs.ini configuration file Change-Id: I8fb296b1b8b17261c46df1eb062ec52d2559307b Signed-off-by: Paul Belanger Reviewed-on: https://review.openstack.org/15035 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins etc/jenkins_jobs.ini-sample | 4 ++++ 1 file changed, 4 insertions(+) commit 7e0ddbe8e9470237bd3868a98ede149b1720e12d Author: william.soula Date: Mon Oct 29 01:55:50 2012 -0500 Adding ability to use the mask passwords plugin Change-Id: I9a6d90399a6a1d6cfd07a5d4694e13b1060a498d Reviewed-on: https://review.openstack.org/14976 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/wrappers.py | 15 +++++++++++++++ setup.py | 1 + 2 files changed, 16 insertions(+) commit 211cd36318cbef5da2fa09baece8572682bd6953 Author: Manuel Desbonnet Date: Wed Sep 26 12:56:29 2012 +0100 Do not output XML if job name not specified ('pipeline', 'trigger-builds') Done in order to enable specifying build pipelines at the project level. Pipelines are built using the 'pipeline' plugin or the 'trigger-builds' plugin. The downstream job to be executed is specified at the project level, and substituted into the template. Ignoring definitions where the downstream job is blank allows the pipeline to be easily terminated. Also adding a samples/ directory, which currently contains an example of pipeline creation, together with a new tools/run-compare-xml-samples.sh to run the before/after test on the samples. Change-Id: Icc324d1485e22db7824ad784890db48eb3e48f8f Reviewed-on: https://review.openstack.org/13706 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Approved: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 4 ++ jenkins_jobs/modules/builders.py | 10 +++++ jenkins_jobs/modules/publishers.py | 13 ++++++- samples/README.md | 8 ++++ samples/pipeline.yaml | 73 ++++++++++++++++++++++++++++++++++++ tools/run-compare-xml-samples.sh | 62 ++++++++++++++++++++++++++++++ 6 files changed, 168 insertions(+), 2 deletions(-) commit 8860e647a0c7c64c7f5bab9e23fee19541a584d1 Author: Tollef Fog Heen Date: Tue Oct 23 13:45:19 2012 +0200 Add support for giving lists to job templates This change allows constructs like: - job-template: name: "foo-build-{slave}" - project: slave: - debian-squeeze-powerpc - debian-squeeze-amd64 and will then instantiate the job template for each value in the list. Change-Id: I057a30ef6d91048efacc4a6da2142cb8f924dd06 Reviewed-on: https://review.openstack.org/14738 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 16 +++++++++++++++- jenkins_jobs/builder.py | 27 ++++++++++++++++++++------- 2 files changed, 35 insertions(+), 8 deletions(-) commit 156c4990f98d1cdd0bdc92830e879bfc84e4fb91 Author: Will Soula Date: Mon Oct 29 08:27:00 2012 -0500 Adding ability to checkout from subversion and use the list tags parameter with the parameterized build plugin Change-Id: Iad9c60d052c85bfb60794e6d2a9d80a915e7d1a8 Reviewed-on: https://review.openstack.org/14675 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/parameters.py | 32 ++++++++++++++++++++++++++ jenkins_jobs/modules/scm.py | 44 ++++++++++++++++++++++++++++++++++++ setup.py | 2 ++ 3 files changed, 78 insertions(+) commit a9e2a2bd9b84af1930e51e76dec36dcc613339c3 Author: william.soula Date: Fri Oct 26 12:49:17 2012 -0500 Fixing documentation for the timed trigger Change-Id: Icdfb6295fb3a2c5bfbb411995bf67e8075197b86 Reviewed-on: https://review.openstack.org/14914 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/triggers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 090eab01db05a260701f636d8af6c3f8b61e5a01 Author: Tollef Fog Heen Date: Fri Oct 19 14:46:31 2012 +0200 Add BuildTrigger support Change-Id: I85caf018a69a24e83a58b76d114c962f1516e104 Reviewed-on: https://review.openstack.org/14736 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 47 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 48 insertions(+) commit 2208256583f36ab1801a232c14d8790b04161f9e Author: william.soula Date: Wed Oct 24 10:12:15 2012 -0500 Adding ability to use the validating-string parameter Change-Id: I15481a9b45d9daf9d759df2e8000956ce060a76a Reviewed-on: https://review.openstack.org/14884 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/parameters.py | 30 ++++++++++++++++++++++++++++++ setup.py | 2 ++ 2 files changed, 32 insertions(+) commit b78a9bf810c22c0e47ed6e1e69a69676e58393be Author: william.soula Date: Fri Oct 26 08:46:45 2012 -0500 Adding ability to use the claim plugin Change-Id: Iff3bc8acc3724cec35fce68b291638dd7185c310 Reviewed-on: https://review.openstack.org/14892 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 15 +++++++++++++++ setup.py | 1 + 2 files changed, 16 insertions(+) commit 86aafe57bc59316705d5e0a6e11e134674cae7d9 Author: Tollef Fog Heen Date: Tue Oct 23 13:44:24 2012 +0200 Add copyartifact builder method Change-Id: I49ebd3056817ca071276d03196175e3caf4a2a51 Reviewed-on: https://review.openstack.org/14737 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/builders.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) commit 6ff1d69d14b536cb17d3a72f5674ceebb0cda9a0 Author: Manuel Desbonnet Date: Wed Sep 26 12:49:50 2012 +0100 Enable job-specific substitutions in a project's job list. The motivation for this was to allow for specifying a pipeline of jobs at the project level, thereby re-using the same job templates in different pipelines. Change-Id: I9840d3713669ceca75a831be92c95c3fe9195c01 Reviewed-on: https://review.openstack.org/13705 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 11 +++++++++++ jenkins_jobs/builder.py | 43 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 6 deletions(-) commit 3739ad3eaed323af900c1d450114313679acebce Author: Manuel Desbonnet Date: Mon Oct 15 11:34:01 2012 +0100 Fix docstring for pipeline publisher. Change-Id: Ie4bc5fed35d39dbca2c3ef9ca185d465df0dc4e2 Reviewed-on: https://review.openstack.org/14457 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 64476daa7ec79d4a0f24a978fcae3c41a697dc22 Author: Antoine Musso Date: Wed Oct 10 15:11:10 2012 +0200 fallback to ./jenkins_job.ini conf When doing developement, we usually want to stick a jenkins_job.ini file at the root of our working directory. The logic still look under /etc/ by default and --conf will override the config file. Test plan: * tox is all green Change-Id: I28781653feb3ce60eb18b50e5b44383d4b544f5a Reviewed-on: https://review.openstack.org/14285 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins-jobs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 2736e1495684f18873403145b2ef82975f835719 Author: Antoine Musso Date: Mon Oct 8 21:18:39 2012 +0200 publisher for xunit Let you describe a publisher for the xUnit Jenkins plugin: https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin import the `logger` module since this publisher is doing a few validations. Example usage: publishers: - xunit: thresholdmode: 'number' thresholds: - skipped: unstablenew: 1 failurenew: 1 types: - phpunit: pattern: "junit.log" stoponerror: false - cppunit: pattern: "cppunit.log" Test plan: * tox is all green * sphinx doc got no warning and looks fine Change-Id: Iab418b9a94e0f538afb7c2a4824ab4ddf421c208 Reviewed-on: https://review.openstack.org/14283 Reviewed-by: David Ripton Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 139 ++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 140 insertions(+) commit 7bec029f059a122f50243338db1bc7c6bb051067 Author: Antoine Musso Date: Sun Oct 7 22:13:09 2012 +0200 builder for ant This let you define an 'ant' builder for those using ant as a build script. Given the YAML input: builders: - ant: "debug" - ant: targets: "test install" buildfile: "foobar.xml" Generates the following XML: debug test install foobar.xml Test plan: * tox is all green * sphinx doc got no warning Change-Id: I9e443c827b7a1b7c3ceff668de518d4cbd7abfff Reviewed-on: https://review.openstack.org/14141 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/builders.py | 51 ++++++++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 52 insertions(+) commit 2b1028dc89388c1682eb9f155386583c43404f73 Author: unicell Date: Mon Oct 8 14:04:00 2012 +0800 Add 'delete-all' subcommand to clear all jobs from Jenkins Change-Id: Ic31b468b6cd1285578038af8f08020e5c4e30c63 Reviewed-on: https://review.openstack.org/13876 Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins-jobs | 15 +++++++++++++++ jenkins_jobs/builder.py | 8 ++++++++ 2 files changed, 23 insertions(+) commit f05c9a3375741194129496ab40aef58a735d0912 Author: Manuel Desbonnet Date: Wed Sep 26 13:44:34 2012 +0100 Add additional search path to fix building of documentation. Sphinx was unable to find the jenkins_jobs.sphinx.yaml module when I ran 'make html' in the doc/ subdirectory. Change-Id: I64817139b149c66b01e3610248b49f955c5bde8c Reviewed-on: https://review.openstack.org/13707 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) commit 5eab9b48991b8b9ce2eab41005c34d0f583cce43 Author: Jon-Paul Sullivan Date: Thu Oct 4 16:43:53 2012 +0100 Correct pip package for Jenkins in README.md Change-Id: Ia0d75275dfea794a0cfcae9d408cc53ccc8ff627 Reviewed-on: https://review.openstack.org/14044 Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5465ab6d4fe36ec6aa853f8252c06df37bdf9ed8 Author: Manuel Desbonnet Date: Wed Sep 19 08:52:35 2012 +0100 Adding hipchat notification capability. Tweaks the Builder and YamlParser classes to accept a config object which is passed to the parser's ModuleRegistry object. This makes it available to the HipChat object. Change-Id: I3017658336b949c0fda7c82945e7014dbcf6e152 Reviewed-on: https://review.openstack.org/12794 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 1 + doc/source/hipchat.rst | 7 +++ jenkins-jobs | 3 +- jenkins_jobs/builder.py | 13 ++-- jenkins_jobs/modules/hipchat_notif.py | 106 +++++++++++++++++++++++++++++++++ setup.py | 1 + 6 files changed, 125 insertions(+), 6 deletions(-) commit b6af0f00606943197a0ba30bfbc15864d9deca22 Author: Manuel Desbonnet Date: Wed Sep 19 08:50:57 2012 +0100 Adding some exception classes Change-Id: I6835f4d20ef1e1d934f60bc096e79b63079f7e92 Reviewed-on: https://review.openstack.org/13270 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/errors.py | 9 +++++++++ 1 file changed, 9 insertions(+) commit 560954b43f8fab66617134ce2620c5c6f13b354f Author: James E. Blair Date: Thu Sep 27 14:03:44 2012 -0700 Add choice parameter type. Change-Id: I6675727cd0638a183e20c0110fcdedfdca3f715a Reviewed-on: https://review.openstack.org/13785 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/parameters.py | 28 ++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 29 insertions(+) commit c82bf22f798a9d05aff6d8ba8ffa7d0117bc0fc5 Author: Antoine Musso Date: Fri Sep 21 21:34:22 2012 +0200 basic README for the newcomers A tiny README file using the markdown syntax, gives out some hints as to how one can install the prerequisites to jenkins-job. Change-Id: I5577b09d9da0d74b8818799e399b570ffbbfcdfb Reviewed-on: https://review.openstack.org/13494 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) commit a7d33f1b0de676f2e1d0000fa26b3e7f6974ff2b Author: James E. Blair Date: Wed Sep 19 21:18:31 2012 +0200 Add email publisher/reporter. Also, add reporters module. Change-Id: I9cd0abca3d90f1af5f275698ecc9ccb7d9086494 Reviewed-on: https://review.openstack.org/13303 Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins doc/source/configuration.rst | 1 + doc/source/reporters.rst | 7 +++ jenkins_jobs/modules/publishers.py | 31 +++++++++++++ jenkins_jobs/modules/reporters.py | 85 ++++++++++++++++++++++++++++++++++++ setup.py | 5 +++ 5 files changed, 129 insertions(+) commit db35627b524a7ad2762fea9a88365cd212b2063a Author: Manuel Desbonnet Date: Wed Sep 19 11:06:44 2012 +0100 Fix typo in --log_level argument help Change-Id: I6899aadddeec6b5e53803d173889890a1e8ebd91 Reviewed-on: https://review.openstack.org/13341 Reviewed-by: Monty Taylor Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins-jobs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 70f83bf756e4fd993141de20b4633de68e13146f Author: Manuel Desbonnet Date: Wed Sep 12 14:11:57 2012 +0100 Allow for deletion of mulitple jobs. Job deletion also clears the job cache, so that a subsequent update will upload even if the job hasn't changed. Change-Id: Ie6d756a469e9f0069532c1327da01d57fe4feffe Reviewed-on: https://review.openstack.org/13268 Reviewed-by: James E. Blair Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins-jobs | 7 ++++--- jenkins_jobs/builder.py | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) commit a760c884333d234e23308cc86805b59587251729 Author: Manuel Desbonnet Date: Wed Sep 19 09:49:36 2012 +0100 Tweak jenkins-jobs to conform with pep8 (v1.2) Change-Id: I91ecac2e8d2d6b6b58f9a7fccc91897270ffe44d Reviewed-on: https://review.openstack.org/13267 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins-jobs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit d4e443e632cfbba13acb8673e268b8a40cb194af Author: James E. Blair Date: Mon Sep 17 23:43:26 2012 +0200 Add some missing docs. Change-Id: I6d726c3ad281cf11e44f37a48256fb88ea1546a2 Reviewed-on: https://review.openstack.org/13165 Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/builders.py | 16 ++++++++++++++++ jenkins_jobs/modules/publishers.py | 25 +++++++++++++++---------- 2 files changed, 31 insertions(+), 10 deletions(-) commit 24b1a19ce9ecfd50299ca84b50503be80fb3d79d Author: Clark Boylan Date: Mon Sep 17 14:45:03 2012 -0700 Make Jenkins Job Builder pass pyflakes checks. One import was not used and another was missing. Change-Id: I2eed26e445e4be1e674df89d29fb5b22dfa9dec4 Reviewed-on: https://review.openstack.org/13163 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/sphinx/yaml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 78c083f590402dc2809545466a7dda1294384174 Author: Clark Boylan Date: Mon Sep 17 14:39:00 2012 -0700 Make code pass pep8 1.2 checks. Change-Id: I5544ce07c7423a0e530860fa5637af26c73f6521 Reviewed-on: https://review.openstack.org/13162 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 1 + jenkins_jobs/modules/builders.py | 8 ++++++-- jenkins_jobs/modules/properties.py | 3 ++- jenkins_jobs/modules/publishers.py | 10 +++++++--- jenkins_jobs/modules/zuul.py | 2 ++ jenkins_jobs/sphinx/yaml.py | 5 ++++- 6 files changed, 22 insertions(+), 7 deletions(-) commit 41b0d13ee6c84a4d3771916567aaab8ad5c1350f Author: Clark Boylan Date: Mon Sep 17 14:11:10 2012 -0700 Add links to required Jenkins plugins in docs. Add links to section docstrings that point at Jenkins plugins required for that particular section to work. Change-Id: Ie5c8de780072b157fbb873227d3ccfa5a2be88f3 Reviewed-on: https://review.openstack.org/13155 Reviewed-by: James E. Blair Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins jenkins_jobs/modules/notifications.py | 2 ++ jenkins_jobs/modules/properties.py | 4 ++++ jenkins_jobs/modules/publishers.py | 10 ++++++++++ jenkins_jobs/modules/scm.py | 2 ++ jenkins_jobs/modules/triggers.py | 2 ++ jenkins_jobs/modules/wrappers.py | 6 ++++++ 6 files changed, 26 insertions(+) commit ab7c6bc6c12a63b898f7cc0d18bd26ae8842d0b4 Author: James E. Blair Date: Tue Sep 11 00:53:26 2012 +0200 Add documentation. Move test.sh to the tools directory. Move parameters and notifications to their own modules; even though they are implemented as Jenkins properties, they make more sense as separate entities in the job builder, because that's they way they are specified in the YAML. All three modules that touch the properties xml object know how to create it if it's missing. Change-Id: I4b42ff10a93fd3ed98f632b58e47f3e0e45086d6 Reviewed-on: https://review.openstack.org/12741 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins .gitignore | 2 + doc/Makefile | 153 ++++++++++++++++++ doc/source/builders.rst | 7 + doc/source/conf.py | 243 +++++++++++++++++++++++++++++ doc/source/configuration.rst | 194 +++++++++++++++++++++++ doc/source/extending.rst | 67 ++++++++ doc/source/general.rst | 10 ++ doc/source/index.rst | 34 ++++ doc/source/installation.rst | 72 +++++++++ doc/source/notifications.rst | 7 + doc/source/parameters.rst | 7 + doc/source/project_freestyle.rst | 7 + doc/source/project_maven.rst | 7 + doc/source/properties.rst | 7 + doc/source/publishers.rst | 7 + doc/source/scm.rst | 7 + doc/source/triggers.rst | 7 + doc/source/wrappers.rst | 7 + doc/source/zuul.rst | 7 + jenkins_jobs/modules/assignednode.py | 19 ++- jenkins_jobs/modules/base.py | 62 ++++++++ jenkins_jobs/modules/builders.py | 57 ++++++- jenkins_jobs/modules/logrotate.py | 24 ++- jenkins_jobs/modules/notifications.py | 74 +++++++++ jenkins_jobs/modules/parameters.py | 166 ++++++++++++++++++++ jenkins_jobs/modules/project_freestyle.py | 22 ++- jenkins_jobs/modules/project_maven.py | 30 +++- jenkins_jobs/modules/properties.py | 144 +++++++++-------- jenkins_jobs/modules/publishers.py | 156 +++++++++++++++--- jenkins_jobs/modules/scm.py | 41 ++++- jenkins_jobs/modules/triggers.py | 122 +++++++++------ jenkins_jobs/modules/wrappers.py | 48 +++++- jenkins_jobs/modules/zuul.py | 27 +++- jenkins_jobs/sphinx/yaml.py | 137 ++++++++++++++++ setup.cfg | 5 + setup.py | 14 +- test.sh | 31 ---- tools/test-requires | 1 + tools/test.sh | 31 ++++ tox.ini | 6 +- 40 files changed, 1860 insertions(+), 209 deletions(-) commit 32128b37f9f56cc3a4766d2c71f95ebfa18910d3 Author: desbonne Date: Mon Sep 10 13:16:42 2012 +0100 Forcing string conversion on boolean parameter Change-Id: Id891e6948b879dfcb8f777f272dc1cb34cd197e8 Reviewed-on: https://review.openstack.org/12793 Reviewed-by: James E. Blair Reviewed-by: Monty Taylor Approved: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/properties.py | 1 + 1 file changed, 1 insertion(+) commit 6ac3c5087ba6971387cbbd2118bbf4a20fd38f04 Author: desbonne Date: Mon Sep 10 13:12:06 2012 +0100 Adding 'pipeline' publisher to enable the build pipeline plugin Change-Id: I0ab567c07c5acd7408d7662ea75dd8513a58888e Reviewed-on: https://review.openstack.org/12792 Reviewed-by: James E. Blair Reviewed-by: Monty Taylor Approved: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 4 ++++ setup.py | 1 + 2 files changed, 5 insertions(+) commit c10f3dbb582a11194f0e82725d6468e83be3a26d Author: desbonne Date: Mon Sep 10 13:08:03 2012 +0100 Adding 'builders-from' builder Change-Id: Id26b073354c5825b8fe91ece83f56a636ea4ae5d Reviewed-on: https://review.openstack.org/12791 Reviewed-by: James E. Blair Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/builders.py | 4 ++++ setup.py | 1 + 2 files changed, 5 insertions(+) commit 80f6594addcde3acd388b4e26798ff055938f062 Author: desbonne Date: Mon Sep 10 13:05:47 2012 +0100 Adding 'current-parameters' option to trigger-builds Change-Id: I651992a7e908b0c859397ec6281238b5e3ac9336 Reviewed-on: https://review.openstack.org/12790 Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins jenkins_jobs/modules/builders.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit ce17c7a10801fe3368eb52ef162b4bb6a4581462 Author: Manuel Desbonnet Date: Wed Sep 12 14:44:22 2012 +0100 Setting throttle values to default to 0 (instead of None) Change-Id: I3d7b24f96efe3b588a727789c4900b9448da891d Reviewed-on: https://review.openstack.org/12875 Reviewed-by: Monty Taylor Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/properties.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 26c62875386e01751c3d01f60e008dfd1f280d69 Author: desbonne Date: Mon Sep 10 12:55:38 2012 +0100 Adding logger (updated following suggestions from jeblair) Change-Id: I8a48cb9dc2c6ea136ce072482467bee292a425f3 Reviewed-on: https://review.openstack.org/12788 Reviewed-by: Monty Taylor Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins-jobs | 14 +++++++++++++- jenkins_jobs/builder.py | 8 ++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) commit 0a00226c0dfbfe5dbaaf7502d6823f5ab263069a Author: desbonne Date: Mon Sep 10 12:46:34 2012 +0100 Adding 'quiet-period' option Change-Id: I0182cad0313411b368d42325f40d09e5da8bc168 Reviewed-on: https://review.openstack.org/12787 Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 2 ++ 1 file changed, 2 insertions(+) commit 631a5603d136daf7b3437680eede352d407bc94e Author: James E. Blair Date: Wed Sep 5 14:15:45 2012 -0700 Remove openstack-specific description. It's in the openstack defaults now. Change-Id: Ib65ed00bec0cea363414e20ec799bde4fb33bac0 Reviewed-on: https://review.openstack.org/12471 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) commit 6924ebc2472d17c26e342434382a20fbb308ac8f Author: James E. Blair Date: Wed Sep 5 14:12:32 2012 -0700 Add defaults. Add a defaults object that will be the lowest priority source of configuration data for jobs. Change-Id: Ie7c9e5a5a84a610e9db02cf191ae1fbd15c7e3b9 Reviewed-on: https://review.openstack.org/12470 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/builder.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) commit f3f09c4f960817a88ec58d437b8a036f5bab832b Author: James E. Blair Date: Wed Sep 5 11:18:01 2012 -0700 Simplify the xml test paths. Make it easier to invoke the tox environments from another project (eg, openstack-ci-puppet). Change-Id: I88305c8edb79bb6e944eb35f5e39c84827807f11 Reviewed-on: https://review.openstack.org/12451 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins tools/run-compare-xml.sh | 14 +++++++++----- tox.ini | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) commit 5d47ef868f2461efd714ea70dac529982c0d5c70 Author: Clark Boylan Date: Tue Sep 4 15:12:06 2012 -0700 Add property injection specification. Add ability to have the Jenkins Job Builder specify a script and property file to use to inject environment variables into builds. Change-Id: I628753ea526735e950b9d17697a08df1b412604f Reviewed-on: https://review.openstack.org/12382 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/properties.py | 22 ++++++++++++++++++++++ setup.py | 1 + 2 files changed, 23 insertions(+) commit cd8a018141b001202a8aeb4afc9268d1c4074e2f Author: James E. Blair Date: Fri Aug 31 21:50:16 2012 -0700 Fix early exit from compare test. Change-Id: I5a871026f2bf7757b7e3e46278391b41e90c5674 Reviewed-on: https://review.openstack.org/12289 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins tools/run-compare-xml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0c2bef08030f6b950e6d6ff65f8db3764d23490f Author: James E. Blair Date: Fri Aug 31 15:15:39 2012 -0700 Add test to determine whether XML output has changed. Change-Id: I5e0b76e195a1b412d180484ce1ddd3e9159d7779 Reviewed-on: https://review.openstack.org/12286 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins .gitignore | 1 + tools/pip-requires | 2 ++ tools/run-compare-xml.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++ tox.ini | 8 +++++++ 4 files changed, 67 insertions(+) commit c3cc3c9c08810f1b8c8f1ce2d566551c8cb97863 Author: James E. Blair Date: Fri Aug 24 08:12:30 2012 -0700 Add rootpom option to maven jobs. Change-Id: I3a865cdc1ae9f92c39033e7b31b490ff7c384b95 Reviewed-on: https://review.openstack.org/11924 Reviewed-by: linuxjedi Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/project_maven.py | 2 ++ 1 file changed, 2 insertions(+) commit 36ca6015bd90fbd018992d378752e80abb3e7aaa Author: James E. Blair Date: Mon Aug 20 17:48:45 2012 -0700 Improve scp publisher. Add copy console, copy after failure, and multiple entries. Change-Id: I7c4917fc0f1b4a30fcca349f2244c02a1898429f Reviewed-on: https://review.openstack.org/11682 Reviewed-by: Monty Taylor Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) commit 891a9d84c6d665ea0a372589fbabef78a3cc7b46 Author: James E. Blair Date: Mon Aug 20 11:10:51 2012 -0700 Add new zuul parameters. Change-Id: I52cd7cbde0f957f144bfd8e6553c00ffee475e4f Reviewed-on: https://review.openstack.org/11661 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/zuul.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) commit 13aab58c9112ecbc604dee7df0d2d260a91f5262 Author: James E. Blair Date: Thu Aug 16 13:34:12 2012 -0700 Change pep8 publisher to generic violations. Change-Id: I94abedc07e0e5884cd737975c65d53375c598f14 Reviewed-on: https://review.openstack.org/11501 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins jenkins_jobs/modules/publishers.py | 66 +++++++++++++++++------------------- setup.py | 2 +- 2 files changed, 32 insertions(+), 36 deletions(-) commit fb0a113eff8a0ee6ea9983ce682bf752cd04e851 Author: James E. Blair Date: Fri Aug 10 16:45:00 2012 -0700 Add tox.ini and pep8, pyflakes cleanup. Change-Id: I4d6312e92dffd596ae58e55c837e3db3ea7d1c52 Reviewed-on: https://review.openstack.org/11198 Reviewed-by: Monty Taylor Approved: James E. Blair Tested-by: Jenkins .gitignore | 1 + jenkins_jobs/builder.py | 111 ++++++++++++++++----------------- jenkins_jobs/modules/builders.py | 17 ++--- jenkins_jobs/modules/logrotate.py | 2 +- jenkins_jobs/modules/project_maven.py | 1 + jenkins_jobs/modules/properties.py | 11 +++- jenkins_jobs/modules/publishers.py | 68 ++++++-------------- jenkins_jobs/modules/scm.py | 11 ++-- jenkins_jobs/modules/triggers.py | 18 ++++-- jenkins_jobs/modules/wrappers.py | 3 +- jenkins_jobs/modules/zuul.py | 1 + setup.py | 2 +- tox.ini | 16 +++++ 13 files changed, 137 insertions(+), 125 deletions(-) commit ab1ee4c6c8065eb407784fb7d3e245d5c5504d47 Author: James E. Blair Date: Tue Aug 14 16:55:20 2012 -0700 Remove openstack config files. Change-Id: Ib2106427e31edb5f487a03ecfbf283ab05c847bf Reviewed-on: https://review.openstack.org/11374 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins projects/openstack/ceilometer.yml | 59 ----- projects/openstack/cinder.yml | 23 -- projects/openstack/devstack-gate.yml | 253 -------------------- projects/openstack/devstack.yml | 23 -- .../gerrit-verification-status-plugin.yml | 22 -- projects/openstack/gerrit.yml | 138 ----------- projects/openstack/gerritbot.yml | 91 ------- projects/openstack/gerritlib.yml | 121 ---------- projects/openstack/glance.yml | 23 -- projects/openstack/heat.yml | 9 - projects/openstack/horizon.yml | 57 ----- projects/openstack/keystone.yml | 23 -- projects/openstack/mraas.yml | 68 ------ projects/openstack/nova.yml | 49 ---- projects/openstack/openstack-ci-puppet.yml | 47 ---- projects/openstack/openstack-common.yml | 23 -- projects/openstack/pbr.yml | 23 -- projects/openstack/pypi-mirror.yml | 47 ---- projects/openstack/python-cinderclient.yml | 23 -- projects/openstack/python-glanceclient.yml | 23 -- projects/openstack/python-keystoneclient.yml | 23 -- projects/openstack/python-novaclient.yml | 23 -- projects/openstack/python-openstackclient.yml | 23 -- projects/openstack/python-quantumclient.yml | 23 -- projects/openstack/python-swiftclient.yml | 23 -- projects/openstack/quantum.yml | 23 -- projects/openstack/reddwarf.yml | 9 - projects/openstack/swift.yml | 23 -- projects/openstack/tempest.yml | 50 ---- projects/openstack/zuul.yml | 62 ----- templates/openstack_publish_jobs.yml | 76 ------ templates/pypi_jobs.yml | 114 --------- templates/python_bitrot_jobs.yml | 108 --------- templates/python_jobs.yml | 212 ---------------- 34 files changed, 1937 deletions(-) commit 813fe7d5f2fcf648414996e3e0e3ff1e791315da Author: James E. Blair Date: Fri Aug 10 16:23:54 2012 -0700 Fix "update" command. Some untested code after the recent refactor was broken. Change-Id: Id8cf33b3d67d86fc18253d8fc91875669a888540 Reviewed-on: https://review.openstack.org/11197 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins jenkins-jobs | 9 +++++---- jenkins_jobs/builder.py | 13 +++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) commit 1b37d05edbff9293756783f2bc0c11d8d8817384 Author: James E. Blair Date: Fri Aug 10 10:02:51 2012 -0700 Remove example config. Change test.sh to expect a config directory, symlinked to config files outside of this project. Change-Id: I84067b494bd8e9ce28c9e74c3556ec78000d83e8 Reviewed-on: https://review.openstack.org/11161 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins .gitignore | 1 + example/ceilometer.yml | 78 -------- example/cinder.yml | 10 - example/devstack-gate.yml | 248 ----------------------- example/devstack.yml | 7 - example/gerrit-verification-status-plugin.yml | 7 - example/gerrit.yml | 130 ------------ example/gerritbot.yml | 13 -- example/gerritlib.yml | 45 ----- example/glance.yml | 10 - example/heat.yml | 7 - example/horizon.yml | 43 ---- example/jenkins-job-builder.yml | 7 - example/keystone.yml | 10 - example/macros.yml | 115 ----------- example/mraas.yml | 82 -------- example/nova.yml | 12 -- example/openstack-ci-puppet.yml | 63 ------ example/openstack-common.yml | 10 - example/openstack-publish-jobs.yml | 89 --------- example/pbr.yml | 10 - example/pypi-jobs.yml | 86 -------- example/pypi-mirror.yml | 8 - example/python-bitrot-jobs.yml | 141 ------------- example/python-cinderclient.yml | 10 - example/python-glanceclient.yml | 10 - example/python-jobs.yml | 267 ------------------------- example/python-keystoneclient.yml | 10 - example/python-novaclient.yml | 10 - example/python-openstackclient.yml | 10 - example/python-quantumclient.yml | 10 - example/python-swiftclient.yml | 10 - example/quantum.yml | 10 - example/reddwarf.yml | 7 - example/requirements.yml | 7 - example/swift.yml | 10 - example/tempest.yml | 8 - example/zuul.yml | 51 ----- test.sh | 8 +- 39 files changed, 7 insertions(+), 1663 deletions(-) commit da4b74b8fa27e852d75b580ef62623cf9ab1ebd4 Author: James E. Blair Date: Fri Aug 10 09:55:31 2012 -0700 Standardize redundant jobs. Add logrotate to ceilometer essex jobs. Use template merge job for devstack-gate (no XML change). Use template merge job for devstack. Use template merge job for gerrit-verification-status-plugin. Use template merge job for gerrit. Use template sdist/pypi jobs for gerritbot. Use template merge job for jenkins-job-builder. Use template merge/pyflakes jobs for pypi-mirror. Use template merge job for requirements. Use template merge/pep8 jobs for tempest. Use template pyflakes job for zuul. Change-Id: If27b9edbbea3d0e9c4ee92a915c64b15420f7f49 Reviewed-on: https://review.openstack.org/11160 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins example/ceilometer.yml | 22 +++---- example/devstack-gate.yml | 37 ++--------- example/devstack.yml | 38 ++---------- example/gerrit-verification-status-plugin.yml | 32 +--------- example/gerrit.yml | 33 +--------- example/gerritbot.yml | 81 +------------------------ example/jenkins-job-builder.yml | 33 +--------- example/openstack-publish-jobs.yml | 2 + example/pypi-jobs.yml | 1 + example/pypi-mirror.yml | 62 +------------------ example/python-bitrot-jobs.yml | 1 + example/requirements.yml | 33 +--------- example/tempest.yml | 67 ++------------------ example/zuul.yml | 32 +--------- 14 files changed, 47 insertions(+), 427 deletions(-) commit 6a5392603ea4c685f6e7336a04b4fb99cd046ed1 Author: James E. Blair Date: Fri Aug 10 09:16:27 2012 -0700 Change all '_' to '-' in YAML for consistency. Change-Id: If19cb26fa544b485acfc188baf3506eaea61d6cf Reviewed-on: https://review.openstack.org/11154 Reviewed-by: Monty Taylor Approved: James E. Blair Tested-by: Jenkins example/ceilometer.yml | 8 ++--- example/devstack-gate.yml | 10 +++---- example/devstack.yml | 2 +- example/gerrit-verification-status-plugin.yml | 2 +- example/gerrit.yml | 40 ++++++++++++------------- example/gerritbot.yml | 8 ++--- example/gerritlib.yml | 4 +-- example/horizon.yml | 2 +- example/jenkins-job-builder.yml | 2 +- example/macros.yml | 18 +++++------ example/mraas.yml | 4 +-- example/openstack-ci-puppet.yml | 6 ++-- example/openstack-publish-jobs.yml | 8 ++--- example/pypi-jobs.yml | 8 ++--- example/pypi-mirror.yml | 4 +-- example/python-jobs.yml | 16 +++++----- example/requirements.yml | 2 +- example/tempest.yml | 4 +-- example/zuul.yml | 6 ++-- jenkins_jobs/modules/builders.py | 4 +-- jenkins_jobs/modules/project_maven.py | 6 ++-- jenkins_jobs/modules/publishers.py | 4 +-- jenkins_jobs/modules/zuul.py | 6 ++-- 23 files changed, 88 insertions(+), 86 deletions(-) commit 8f0984169379a1845686d4debfbb7dfbce470978 Author: James E. Blair Date: Tue Aug 7 14:11:29 2012 -0700 Refactor modules and templating. Switch to using entry points for loading modules as well as individual buliders, triggers, publishers, etc. Remove most openstack-specific python code. Change templating so it's less repetitive -- a single project definition will suffice for multiple jobs or job-groups. This outputs XML that is identical to the current production XML, warts and all. There are significant improvements that can be made to the YAML in a separate change, as they will cause minor changes to existing jobs (adding timestamps, logrotate, etc.). These are mostly marked with TODO in this change. Change-Id: Idcfddb3b43b6cfef4b20919a84540706d7a0a0b1 Reviewed-on: https://review.openstack.org/11000 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins .gitignore | 2 + example/ceilometer.yml | 80 ++++++ example/cinder.yml | 10 + example/devstack-gate.yml | 273 ++++++++++++++++++++ example/devstack.yml | 33 +++ example/gerrit-verification-status-plugin.yml | 35 +++ example/gerrit.yml | 159 ++++++++++++ example/gerritbot.yml | 90 +++++++ example/gerritlib.yml | 45 ++++ example/glance.yml | 10 + example/heat.yml | 7 + example/horizon.yml | 43 ++++ example/jenkins-job-builder.yml | 34 +++ example/keystone.yml | 10 + example/macros.yml | 115 +++++++++ example/mraas.yml | 82 ++++++ example/nova.yml | 12 + example/openstack-ci-puppet.yml | 63 +++++ example/openstack-common.yml | 10 + example/openstack-publish-jobs.yml | 87 +++++++ example/pbr.yml | 10 + example/pypi-jobs.yml | 85 +++++++ example/pypi-mirror.yml | 64 +++++ example/python-bitrot-jobs.yml | 140 +++++++++++ example/python-cinderclient.yml | 10 + example/python-glanceclient.yml | 10 + example/python-jobs.yml | 267 ++++++++++++++++++++ example/python-keystoneclient.yml | 10 + example/python-novaclient.yml | 10 + example/python-openstackclient.yml | 10 + example/python-quantumclient.yml | 10 + example/python-swiftclient.yml | 10 + example/quantum.yml | 10 + example/reddwarf.yml | 7 + example/requirements.yml | 34 +++ example/swift.yml | 10 + example/tempest.yml | 67 +++++ example/zuul.yml | 79 ++++++ jenkins-jobs | 47 ++++ jenkins_jobs.py | 279 --------------------- jenkins_jobs/builder.py | 274 ++++++++++++++++++++ jenkins_jobs/modules/assignednode.py | 31 +++ jenkins_jobs/modules/base.py | 58 +++++ jenkins_jobs/modules/builders.py | 63 +++++ jenkins_jobs/modules/logrotate.py | 41 +++ jenkins_jobs/modules/project_freestyle.py | 32 +++ jenkins_jobs/modules/project_maven.py | 55 +++++ jenkins_jobs/modules/properties.py | 117 +++++++++ jenkins_jobs/modules/publishers.py | 290 ++++++++++++++++++++++ jenkins_jobs/modules/scm.py | 72 ++++++ jenkins_jobs/modules/triggers.py | 124 ++++++++++ jenkins_jobs/modules/wrappers.py | 51 ++++ jenkins_jobs/modules/zuul.py | 85 +++++++ modules/assignednode.py | 36 --- modules/builders.py | 161 ------------ modules/logrotate.py | 49 ---- modules/project_freestyle.py | 39 --- modules/project_maven.py | 61 ----- modules/properties.py | 90 ------- modules/publishers.py | 329 ------------------------- modules/scm.py | 74 ------ modules/triggers.py | 129 ---------- modules/wrappers.py | 53 ---- modules/zuul.py | 79 ------ projects/openstack/zuul.yml | 133 +++++----- setup.py | 90 +++++++ test.sh | 23 +- 67 files changed, 3547 insertions(+), 1461 deletions(-) commit ae673c9ac27106157d4074cdf65189be716964f8 Author: James E. Blair Date: Fri Aug 3 16:35:02 2012 -0700 Add .gitreview. Change-Id: I23d8005abdb57268d40d0c834fc62387be9cf70b Reviewed-on: https://review.openstack.org/10809 Approved: Monty Taylor Reviewed-by: Monty Taylor Approved: James E. Blair Tested-by: Jenkins .gitreview | 4 ++++ 1 file changed, 4 insertions(+) commit 24d852e72f031087b1b4e8eaba8f82bbcdc61ea9 Author: James E. Blair Date: Fri Aug 3 09:44:30 2012 -0700 Set timeouts for all jobs. Mostly set to 20 minutes to start. A few with different values. Change-Id: If388f2281dd49caed391748bdb9ec8090cc29380 projects/openstack/ceilometer.yml | 4 ++++ projects/openstack/devstack-gate.yml | 6 ++++++ projects/openstack/devstack.yml | 2 ++ .../gerrit-verification-status-plugin.yml | 2 ++ projects/openstack/gerrit.yml | 8 ++++++++ projects/openstack/gerritbot.yml | 6 ++++++ projects/openstack/gerritlib.yml | 8 ++++++++ projects/openstack/horizon.yml | 2 ++ projects/openstack/mraas.yml | 4 ++++ projects/openstack/openstack-ci-puppet.yml | 4 ++++ projects/openstack/pypi-mirror.yml | 4 ++++ projects/openstack/tempest.yml | 4 ++++ projects/openstack/zuul.yml | 4 ++++ templates/openstack_publish_jobs.yml | 4 ++++ templates/pypi_jobs.yml | 6 ++++++ templates/python_bitrot_jobs.yml | 6 ++++++ templates/python_jobs.yml | 12 ++++++++++++ 17 files changed, 86 insertions(+) commit f5fd2026f887706e7152c97987f8151c782cd09e Author: James E. Blair Date: Fri Aug 3 09:31:12 2012 -0700 Add periodic bitrot check jobs. Add jobs that run daily to make sure stable branches still pass tests. Added as a template that can be added to any project and any branch. Change-Id: I90c2bab2afd8e1ad7077f3473504069b0dad9876 modules/scm.py | 8 +-- projects/openstack/nova.yml | 26 ++++++++++ templates/python_bitrot_jobs.yml | 102 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+), 3 deletions(-) commit 0f3693b7ae0faa844ee0e5c78a8ef51616f7cd24 Author: James E. Blair Date: Thu Aug 2 13:04:00 2012 -0700 Use oneiric for stable/diablo. For all python27 jobs, use oneiric slaves if the branch is stable/diablo. Python26 jobs are already on oneiric due to lack of python 2.6 on anything later. Change-Id: Id440e14721ccdd4225c5e5b170510c3c000a36b3 templates/python_jobs.yml | 6 ++++++ 1 file changed, 6 insertions(+) commit cafb46c434512b19a3df9f5c3d4b8e3907bffedc Author: James E. Blair Date: Thu Aug 2 09:29:16 2012 -0700 Fix zuul-docs being disabled. Change-Id: I3c314ac41748be0443390e29c4e7fb89bae1e022 projects/openstack/zuul.yml | 1 - 1 file changed, 1 deletion(-) commit 9a2931100ff774018be209a992249949b14ad082 Author: Clark Boylan Date: Wed Aug 1 09:38:14 2012 -0700 Switch zuul to jenkins python jobs template. Switch zuul jenkins jobs config to use the python jobs template. The gate-zuul-pyflakes job has been kept though. Add zuul-docs job as well. Configure the zuul layout to gate zuul on python26 and python27 jobs. Also configured to run the zuul-coverage job and zuul-docs job post merge. Change-Id: Ib3500c361bca0e2c35fa9552b0aa98468d2f040f modules/publishers.py | 19 ++++++++++++++- projects/openstack/zuul.yml | 54 +++++++++++++++++++++---------------------- 2 files changed, 45 insertions(+), 28 deletions(-) commit 2be800ec2d5ef3fcc2cfb74b077977eb5abcb5b1 Author: Clark Boylan Date: Wed Jul 25 15:05:19 2012 -0700 Collect Xunit results from horizon selenium tests. Add configuration to collect Xunit test results from the selenium tests as they are just additional unit tests. Change-Id: Ia6396330630826861b0eba07855a810c05814086 projects/openstack/horizon.yml | 4 ++++ 1 file changed, 4 insertions(+) commit 5baa8ae9272fbc3a14eb98629d679bf840c7b3a6 Author: Clark Boylan Date: Mon Jul 23 13:40:38 2012 -0700 Add framework for selenium tests on test slaves. Fixes bug #996190 Add framework to run selenium tests on the test slaves. This includes installing the firefox and Xvfb packages, wrapping Horizon selenium tests with a script that creates an Xvfb X server, and running the Horizon selenium tests as check tests. The framework assumes selenium tests will use the WebDriver API and not need any other pieces of selenium (No selenium server etc). Change-Id: I4f4cc502276890d617b5baaadf5f8a6eae1ba1ff modules/builders.py | 3 +++ projects/openstack/horizon.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) commit 3d410a6dae1d6e89d2fc306ff6a36e3be4558bad Author: Monty Taylor Date: Thu Jul 19 23:09:36 2012 -0700 Trim down some un-needed repetition. Adding a yml file to the project but not listing it in the .pp file only really ever caused bugs. Moved the full openstack project list to a variable for re-use. Change-Id: I211b5cf54d5a84c6136a4b04ea819c688cc1e2b6 jenkins_jobs.py | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) commit 2c9d4130d3e9480c924d6527a1b29028f533c68d Author: Monty Taylor Date: Thu Jul 12 17:47:40 2012 -0500 Add PBR to Jenkins/zuul. Change-Id: Ia7e55da35f7f463c924fd1441f87c78295af6d86 projects/openstack/pbr.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 289de3806533f5bf7dcc7b2618ca79d4253f2bbf Author: James E. Blair Date: Wed Jul 11 11:22:27 2012 -0700 Use devstack-oneiric for stable/diablo. Add custom function to determine node label to use for devstack gate jobs. Add support for the 'label' parameter type to job builder. Add label parameters to the devstack gate jobs. Change-Id: Ic7d5a45e97c94dd72606431d57a67b21f374adb7 modules/properties.py | 1 + projects/openstack/devstack-gate.yml | 12 ++++++++++++ 2 files changed, 13 insertions(+) commit aa74b4d4d66df46b01f7453a9d642437cdff55eb Merge: 8704a81 551af46 Author: Jenkins Date: Tue Jul 10 18:18:19 2012 +0000 Merge "Set pipefail when running `tox | tee`." commit 8704a812706c0b8fb7eb50f262733292fd5f12d3 Merge: e7af61d 0a76530 Author: Jenkins Date: Tue Jul 10 18:18:17 2012 +0000 Merge "Add gerritbot and gerritlib jobs." commit e7af61de316a0b2c269f77875de6164b8e571690 Author: James E. Blair Date: Mon Jul 9 20:11:04 2012 -0700 Collect tempest nosetests output files. Change-Id: If0120c19c775b5130da860f0120b61d414ad5d8d projects/openstack/devstack-gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0a7653098c5de5496c671e90f7b365c32b3d0c34 Author: James E. Blair Date: Mon Jul 9 15:45:16 2012 -0700 Add gerritbot and gerritlib jobs. Change-Id: Ibfa9b824b7e05b7d0997b27d9118a3d426aeb7f0 projects/openstack/gerritbot.yml | 85 ++++++++++++++++++++++++++++ projects/openstack/gerritlib.yml | 113 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+) commit 551af460afc20b61c0bf3fc829dfb1f91cc82585 Author: Clark Boylan Date: Mon Jul 9 12:35:42 2012 -0700 Set pipefail when running `tox | tee`. Pep8 tests had previously been run as `tox -v -epep8 | tee pep8.txt` which would not fail if tox returned a non zero exit status because pipes return the status of the last command by default. Set pipefail to cause pep8 test failures to not be masked by tee. Change-Id: I8441dbd431d0170b93e72e76d34b62d62b5d8286 modules/builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e5d2267b71b2284f89eb8c91cebd8c195ea286c8 Author: James E. Blair Date: Fri Jul 6 13:07:20 2012 -0700 Add gerrit-verification-status-plugin project. Change-Id: Idc43f0716d152f623459369cab84d6166e140a88 .../gerrit-verification-status-plugin.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 6fda77c1826fae8b87e832d78d3fc3cda36583af Author: Monty Taylor Date: Thu Jul 5 09:34:25 2012 -0500 Split jobs into multiple templates. Change-Id: Ic5f6075aa67cc0819bbccab9295f715920f40bcd projects/openstack/ceilometer.yml | 3 - projects/openstack/cinder.yml | 11 + projects/openstack/glance.yml | 11 + projects/openstack/heat.yml | 3 - projects/openstack/horizon.yml | 11 + projects/openstack/keystone.yml | 11 + projects/openstack/nova.yml | 11 + projects/openstack/openstack-common.yml | 11 + projects/openstack/python-cinderclient.yml | 13 +- projects/openstack/python-glanceclient.yml | 13 +- projects/openstack/python-keystoneclient.yml | 13 +- projects/openstack/python-novaclient.yml | 13 +- projects/openstack/python-openstackclient.yml | 13 +- projects/openstack/python-quantumclient.yml | 13 +- projects/openstack/python-swiftclient.yml | 13 +- projects/openstack/quantum.yml | 11 + projects/openstack/reddwarf.yml | 3 - projects/openstack/swift.yml | 11 + templates/openstack_publish_jobs.yml | 72 ++++++ templates/pypi_jobs.yml | 108 ++++++++ templates/python_jobs.yml | 72 ------ templates/python_library_jobs.yml | 330 ------------------------- 22 files changed, 352 insertions(+), 418 deletions(-) commit 47b26252d50981aa5c300dbbd16c7d6ac25447c1 Author: Monty Taylor Date: Thu Jul 5 08:53:36 2012 -0500 Run gerrit-git-prep in docs/coverage jobs. Change-Id: Ia22ba27889bc3ca52bbd7c632f692a4b07e97144 templates/python_jobs.yml | 3 +++ templates/python_library_jobs.yml | 47 ++++++++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 6 deletions(-) commit 0fc3d48a310d51414a7b4a02c41f670e4c598af3 Merge: 8c7f09a a35d316 Author: Jenkins Date: Thu Jul 5 11:04:20 2012 +0000 Merge "Trigger docs and coverage via zuul." commit 8c7f09ae2119b84a2346ad33867a25fc43da89f9 Author: Monty Taylor Date: Wed Jul 4 11:26:10 2012 -0500 Only build tarball once for client libs. For any given revision, we should only ever create one tarball. Similarly, we should upload that tarball and only that tarball to tarballs.openstack.org as well as pypi if it's appropriate to do so. Library projects are sufficiently different at this point that I made a different template for them. It would be neat if we could get nested templates. Change-Id: Iec81d0d5c0c3a4a8021213fe4bb6884c45fb483a projects/openstack/python-cinderclient.yml | 25 +-- projects/openstack/python-glanceclient.yml | 25 +-- projects/openstack/python-keystoneclient.yml | 25 +-- projects/openstack/python-novaclient.yml | 25 +-- projects/openstack/python-openstackclient.yml | 25 +-- projects/openstack/python-quantumclient.yml | 25 +-- projects/openstack/python-swiftclient.yml | 25 +-- templates/python_library_jobs.yml | 295 +++++++++++++++++++++++++ 8 files changed, 302 insertions(+), 168 deletions(-) commit 21543b92d6f25892b5164dee169fc3b9e21990c1 Author: Andrew Hutchings Date: Wed Jul 4 13:49:51 2012 +0100 Make Jenkins use Openstack instead of Stackforge Make the Jenkins Jobs talk to Openstack's Gerrit for branches Change-Id: Ifbe16a0828aede84814e61e026b2542b2d7c633b projects/openstack/ceilometer.yml | 6 +++--- projects/openstack/heat.yml | 2 +- projects/openstack/mraas.yml | 4 ++-- projects/openstack/reddwarf.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) commit 802c158aa1ec1150159dfeffe795607538437468 Author: Andrew Hutchings Date: Wed Jul 4 13:08:18 2012 +0100 Migrate Stackforge Jenkins/Gerrit to OpenStack This moves all the projects from Stackforge to OpenStack and removes Stackforge configs. Change-Id: I8d5e9f7b12fdeae4c811b72040732841bbe0818b projects/openstack/ceilometer.yml | 58 ++++++++++++++++++++++++++++++++ projects/openstack/heat.yml | 12 +++++++ projects/openstack/mraas.yml | 64 ++++++++++++++++++++++++++++++++++++ projects/openstack/reddwarf.yml | 12 +++++++ projects/stackforge/ceilometer.yml | 58 -------------------------------- projects/stackforge/heat.yml | 12 ------- projects/stackforge/mraas.yml | 64 ------------------------------------ projects/stackforge/reddwarf.yml | 12 ------- 8 files changed, 146 insertions(+), 146 deletions(-) commit a35d316f938ebcadb779ceaed0b470e49452fb7a Author: Monty Taylor Date: Wed Jun 13 14:08:01 2012 -0400 Trigger docs and coverage via zuul. Additionally, add docs to the gate. Additionally, upload docs for tagged revisions to a subdir. Change-Id: Ie15eac1823a9b1775574b0f23c6e86f5461f1b35 templates/python_jobs.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) commit eefae4da773bfdcc46948122b5fa4526e7f521da Author: Monty Taylor Date: Mon Jul 2 11:45:37 2012 -0400 Upload client lib tarballs to their own place. Change-Id: I29c5a78fc251e5fbfca856a62f08797e2e070dde projects/openstack/python-cinderclient.yml | 2 +- projects/openstack/python-glanceclient.yml | 2 +- projects/openstack/python-keystoneclient.yml | 2 +- projects/openstack/python-novaclient.yml | 2 +- projects/openstack/python-quantumclient.yml | 2 +- projects/openstack/python-swiftclient.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) commit c3286860a441ee18d37962925945dd54eb36e540 Author: Monty Taylor Date: Sun Jul 1 15:41:13 2012 -0400 Run pypi uploads on a pypi slave. PyPI uploads build a venv so that they can properly build an sdist tarball. We need to do this on a proper slave for build depends. Change-Id: Ibaac628890598ca87c43373777e3814a0692bfd8 projects/openstack/python-cinderclient.yml | 2 +- projects/openstack/python-glanceclient.yml | 2 +- projects/openstack/python-keystoneclient.yml | 2 +- projects/openstack/python-novaclient.yml | 2 +- projects/openstack/python-openstackclient.yml | 2 +- projects/openstack/python-quantumclient.yml | 2 +- projects/openstack/python-swiftclient.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) commit 11f9e792a184776f22a2c93c8033d9cfa57e4b5c Merge: e09851f 74e7f68 Author: Jenkins Date: Fri Jun 29 19:44:39 2012 +0000 Merge "Disable authenticated builds globally." commit e09851fbfb2857618225ba737fec9c1214828b12 Merge: 4815455 ff86268 Author: Jenkins Date: Fri Jun 29 07:22:32 2012 +0000 Merge "Add Jenkins jobs for openstack-common. Will gate." commit 48154551bbedf52a753833e49b93cb99b457207b Author: Monty Taylor Date: Thu Jun 28 12:37:15 2012 -0700 Use zuul_post trigger instead of zuul trigger. Change-Id: Icf8d555e2f072c73bdd4748cb4a314ec30b37838 projects/openstack/python-cinderclient.yml | 2 +- projects/openstack/python-glanceclient.yml | 2 +- projects/openstack/python-keystoneclient.yml | 2 +- projects/openstack/python-novaclient.yml | 2 +- projects/openstack/python-openstackclient.yml | 2 +- projects/openstack/python-quantumclient.yml | 2 +- projects/openstack/python-swiftclient.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) commit 172d8c3bf4360f1cbfcfd186267c5b6518b38e25 Merge: ea9ff6e 54e5aa3 Author: Jenkins Date: Thu Jun 28 17:46:28 2012 +0000 Merge "First stab at auto-uploads." commit 74e7f68df614cb873ddc4d0d647aa511a5d26190 Author: James E. Blair Date: Mon Jun 25 19:38:17 2012 -0300 Disable authenticated builds globally. This is not relevant (and slightly dangerous) with Zuul. Change-Id: I08ac177d87fbdaeedbab590740adb1403213ef57 projects/openstack/gerrit.yml | 6 +++--- projects/stackforge/ceilometer.yml | 4 ++-- projects/stackforge/mraas.yml | 4 ++-- templates/python_jobs.yml | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) commit ff8626800ee25d8dc5d37aec3eaeb8627f582caa Author: Clark Boylan Date: Mon Jun 25 13:38:15 2012 -0700 Add Jenkins jobs for openstack-common. Will gate. Fixes bug #1010610 Add Jenkins jobs for openstack-common using the python_jobs template. Configure zuul to check and gate on the pep8 and unittest jobs. Change-Id: I3b6f0a8b5aa06486d32574fffa48f3bd0f9e906a projects/openstack/openstack-common.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit ea9ff6e147f1bdeb018f8a2d0f6796522cef3ef1 Author: Doug Hellmann Date: Mon Jun 25 16:56:48 2012 -0400 Remove disabled flag from python27-essex Zuul and Jenkins are out of sync. Remove the flag here to fix it. Change-Id: I453196a51a86f4245d6918752110a2f7108e003a projects/stackforge/ceilometer.yml | 1 - 1 file changed, 1 deletion(-) commit 5f4f27d47d478868eb0985f34a806076f16b6218 Author: Doug Hellmann Date: Mon Jun 25 15:48:59 2012 -0400 Fix spelling of ceilometer job names Change-Id: Ib9158f383052962e0220dd46ae10b868c291e194 projects/stackforge/ceilometer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 54e5aa32010db21953447a6cfc747b3f57ea0bb4 Author: Monty Taylor Date: Mon Jun 25 12:34:54 2012 -0500 First stab at auto-uploads. Change-Id: Id433f2cef8effbf3623520e73d5c447a8db2d91a projects/openstack/python-cinderclient.yml | 23 +++++++++++++++++++++++ projects/openstack/python-glanceclient.yml | 23 +++++++++++++++++++++++ projects/openstack/python-keystoneclient.yml | 23 +++++++++++++++++++++++ projects/openstack/python-novaclient.yml | 23 +++++++++++++++++++++++ projects/openstack/python-openstackclient.yml | 23 +++++++++++++++++++++++ projects/openstack/python-quantumclient.yml | 23 +++++++++++++++++++++++ projects/openstack/python-swiftclient.yml | 23 +++++++++++++++++++++++ 7 files changed, 161 insertions(+) commit fc4a04e2313bb0ea26a62eb0ebbab6c1e2c1abb5 Author: James E. Blair Date: Fri Jun 22 07:47:34 2012 -0700 Move client tarballs to main project. python-novaclient tarballs should be in nova/tarballs. Add a project parameter to the tarball publisher to handle that, and update the yaml accordingly. Change-Id: I184bd4b43e7cc86574ec011e8b2cf0cd14569553 modules/publishers.py | 3 ++- projects/openstack/cinder.yml | 1 + projects/openstack/glance.yml | 1 + projects/openstack/horizon.yml | 1 + projects/openstack/keystone.yml | 1 + projects/openstack/nova.yml | 1 + projects/openstack/python-cinderclient.yml | 1 + projects/openstack/python-glanceclient.yml | 1 + projects/openstack/python-keystoneclient.yml | 1 + projects/openstack/python-novaclient.yml | 1 + projects/openstack/python-openstackclient.yml | 1 + projects/openstack/python-quantumclient.yml | 1 + projects/openstack/python-swiftclient.yml | 1 + projects/openstack/quantum.yml | 1 + projects/openstack/swift.yml | 1 + projects/stackforge/ceilometer.yml | 1 + projects/stackforge/heat.yml | 1 + projects/stackforge/reddwarf.yml | 1 + templates/python_jobs.yml | 1 + 19 files changed, 20 insertions(+), 1 deletion(-) commit ced389e70c838d9f2534e905684c7182099844b2 Author: James E. Blair Date: Thu Jun 21 11:45:02 2012 -0700 Discard old builds on more jobs. And make some changes to current values. Change-Id: Ie40540559bacc4d44075ba054aa20dac6bc8b98a projects/openstack/devstack-gate.yml | 10 +++++-- templates/python_jobs.yml | 54 ++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 8 deletions(-) commit 6ec3a5cc9a68b50583771063f5431d332c3c432b Author: James E. Blair Date: Thu Jun 21 11:11:50 2012 -0700 Remove buildWrappers from base xml. It's in a module now. Change-Id: I96ef714cfb96b8085580bae284250a0c94fef1a5 jenkins_jobs.py | 1 - 1 file changed, 1 deletion(-) commit 62ea28d83eebd687c8db1c8b37176fe32ce6f494 Author: James E. Blair Date: Wed Jun 20 11:28:07 2012 -0700 Add devstack jobs to job builder. Change-Id: I933ea00356809cf13018761cad7344bb6855b867 modules/triggers.py | 2 +- modules/wrappers.py | 35 +++--- projects/openstack/devstack-gate.yml | 208 ++++++++++++++++++++++++++++++++++ 3 files changed, 231 insertions(+), 14 deletions(-) commit 758252ab66597d9bdfd09f90829075087b2b363e Author: James E. Blair Date: Mon Jun 18 17:33:47 2012 -0700 Abate modules section. This is the first in a series of changes to alter the way modules are handled. This change removes the module section from yaml. Instead, all files in modules/ are imported, and a 'register' function is called if it exists. The register function can add (any number of) module classes to a module registry. The registry will also keep track of helper functions for use by other modules, and the register function can add those. This sets up the ability for a module other than the 'builders' module to register builders. Eventually, we should be able to move all OpenStack specific builders, publishers, etc outside of the base modules; instead we would just register an 'openstack_pep8' builder in a module of our own that the job filler would know to invoke. The API for modules is slightly changed, adding a root_xml method to handle the different project types, a handle_data method for modules that want to modify the yaml data structure before any XML is generated, and a data parameter is added to the generate_xml method. Ideally, we will migrate those modules that count on having a centrally stored data object to using the one passed into this method to allow maximum flexibility. I also envision some project-level yaml attributes to be moved closer to the handlers that use them. This change does inadvertently alter the XML produced. Here is the result of test.sh: http://paste.openstack.org/show/18585/ In all cases, those are inconsistencies in the YAML that are corrected by this change. Some jobs included an empty triggers vector (due to module trigger_none) while others did not, so there was no way to satisfy both behaviors. The added postbuilder section in the gerrit maven job is there because the job specified postbuilders, but did not include the postbuilder module. I believe the resulting XML is more desirable. Change-Id: Ib38222e6bfc9d5b55aa497669d7023c7aaf4b7bc jenkins_jobs.py | 79 ++++++++++------- modules/assignednode.py | 15 ++-- modules/builders.py | 80 ++++++++++------- modules/logrotate.py | 14 ++- modules/project_freestyle.py | 39 +++++++++ modules/project_maven.py | 21 +++-- modules/properties.py | 13 ++- modules/publishers.py | 46 +++++++--- modules/scm.py | 14 ++- modules/trigger_gerrit.py | 79 ----------------- modules/trigger_none.py | 26 ------ modules/trigger_pollscm.py | 33 ------- modules/trigger_timed.py | 33 ------- modules/triggers.py | 129 ++++++++++++++++++++++++++++ modules/zuul.py | 20 +++-- projects/openstack/devstack-gate.yml | 8 -- projects/openstack/devstack.yml | 8 -- projects/openstack/gerrit.yml | 37 -------- projects/openstack/openstack-ci-puppet.yml | 16 ---- projects/openstack/pypi-mirror.yml | 16 ---- projects/openstack/tempest.yml | 16 ---- projects/openstack/zuul.yml | 24 ------ projects/stackforge/ceilometer.yml | 16 ---- projects/stackforge/mraas.yml | 72 +++++++--------- templates/python_jobs.yml | 74 +--------------- 25 files changed, 396 insertions(+), 532 deletions(-) commit c46ce5546727ca633531fce4b4cf364faca30193 Author: James E. Blair Date: Fri Jun 15 17:26:38 2012 -0700 Add Zuul module to job filler. Move configuration of Zuul parameters to a job filler module. Note: I've used "triggers:" instead of "trigger:"; I'd like to move the other triggers to use that and be more like the "builders:" section. Change-Id: I28af1f795f4e304faaf0e687bc3fdc76949a7664 modules/zuul.py | 77 ++++++++++++++++++++ projects/openstack/devstack-gate.yml | 20 +----- projects/openstack/devstack.yml | 20 +----- projects/openstack/gerrit.yml | 83 ++++------------------ projects/openstack/openstack-ci-puppet.yml | 40 ++--------- projects/openstack/pypi-mirror.yml | 40 ++--------- projects/openstack/tempest.yml | 40 ++--------- projects/openstack/zuul.yml | 60 +++------------- projects/stackforge/ceilometer.yml | 40 ++--------- templates/python_jobs.yml | 104 +++++----------------------- 10 files changed, 144 insertions(+), 380 deletions(-) commit 49698ab6811af07730f8fe54542d935483d4c3e1 Author: James E. Blair Date: Fri Jun 15 16:26:46 2012 -0700 Fix syntax errors in ceilometer. Change-Id: I0fe47a3ec9ea22a9f4122fdb7302447183125fa0 projects/stackforge/ceilometer.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 49c33f472dae5ce32c35fc25e5154381f60b0714 Merge: c9a7b16 154bae0 Author: Jenkins Date: Fri Jun 15 20:42:36 2012 +0000 Merge "Add py26-essex and py27-essex jobs to ceilometer" commit c9a7b164ee195ca6f39d35a4669f5490eb2dd7f0 Author: James E. Blair Date: Thu Jun 14 16:30:56 2012 -0700 Changes to builders/publishers. Make the following changes to builders and publishers in service of being able to handle this job: http://paste.openstack.org/show/18541/ * Allow builders to have attributes * Add a generic shell script builder * Make the 'project' job attribute optional (no link to github will be made in that case) * Combine all separate publishers into one publisher module so that jobs may have more than one publisher * Name the section that lists publishers "post_build_actions" to be consistent with the web UI * Allow publishers to have attributes * Add an archive artifacts publisher * Add a parameterized build trigger publisher * Add a parameterized build_trigger builder * Add wrappers * Add a build timeout wrapper * Add a timstamp wrapper Also, make the following small improvements: * The 'disabled' attribute of a job is optional, defaults to false. * Add a script to verify XML output is the same before and after a change to the job filler (test.sh) Change-Id: Icf2228494e431f5bf0a5f051f63842f12f6f92f1 jenkins_jobs.py | 5 +- modules/builders.py | 31 ++- modules/properties.py | 8 +- modules/publisher_coverage.py | 63 ------ modules/publisher_docs.py | 45 ----- modules/publisher_ftp.py | 97 --------- modules/publisher_junit.py | 33 ---- modules/publisher_none.py | 26 --- modules/publisher_pep8.py | 74 ------- modules/publisher_ppa.py | 29 --- modules/publisher_tarball.py | 39 ---- modules/publisher_war.py | 41 ---- modules/publishers.py | 293 ++++++++++++++++++++++++++++ modules/wrappers.py | 44 +++++ projects/openstack/devstack-gate.yml | 3 +- projects/openstack/devstack.yml | 3 +- projects/openstack/gerrit.yml | 33 ++-- projects/openstack/openstack-ci-puppet.yml | 6 +- projects/openstack/pypi-mirror.yml | 6 +- projects/openstack/tempest.yml | 9 +- projects/openstack/zuul.yml | 12 +- projects/stackforge/mraas.yml | 6 +- templates/python_jobs.yml | 77 +++++--- test.sh | 26 +++ 24 files changed, 482 insertions(+), 527 deletions(-) commit f2a0f596c10cc97ec7b12aa8a28d2abb17c97ec3 Author: Clark Boylan Date: Wed Jun 13 11:20:18 2012 -0700 Update doc FTP destination dir. It has been decided that sphinx docs should be uploaded to ftp://server/developer/project instead of ftp://server/dev/docs/project. Change-Id: I64fe0fc98ee2ed93a8ec71bca52db9471db94fb3 templates/python_jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1e0fe626d1c6bf52273b13349a7e54c33cc92a27 Author: Clark Boylan Date: Thu Jun 7 13:39:27 2012 -0700 Add FTP doc publishing job. Need to publish documentation to docs.openstack.org. This host does not speak SCP so we cannot use the old SCP documentation publishing job. Replace SCP job with an FTP job (which docs.openstack.org does speak) in order to publish documentation destined for docs.openstack.org. Change-Id: Ie528389c919179eac5fe6c0ca78e3dbe2251bd00 modules/publisher_ftp.py | 97 +++++++++++++++++++++++++ projects/openstack/cinder.yml | 1 + projects/openstack/glance.yml | 1 + projects/openstack/horizon.yml | 1 + projects/openstack/keystone.yml | 1 + projects/openstack/nova.yml | 1 + projects/openstack/python-cinderclient.yml | 1 + projects/openstack/python-glanceclient.yml | 1 + projects/openstack/python-keystoneclient.yml | 1 + projects/openstack/python-novaclient.yml | 1 + projects/openstack/python-openstackclient.yml | 1 + projects/openstack/python-quantumclient.yml | 1 + projects/openstack/python-swiftclient.yml | 1 + projects/openstack/quantum.yml | 1 + projects/openstack/swift.yml | 1 + projects/stackforge/ceilometer.yml | 1 + projects/stackforge/heat.yml | 1 + projects/stackforge/reddwarf.yml | 1 + templates/python_jobs.yml | 8 +- 19 files changed, 120 insertions(+), 2 deletions(-) commit 9908fb099bab4474c3f768e4ffdc36d1dcfc5309 Author: Monty Taylor Date: Tue Jun 12 09:37:21 2012 -0400 Remove melange related jobs. Change-Id: Id97d94c495c4a021786d28df813c863adac8984f projects/openstack/melange.yml | 10 ---------- projects/openstack/python-melangeclient.yml | 10 ---------- 2 files changed, 20 deletions(-) commit eb6be5e2ab262c9e026de90a55e55ea1c808096b Author: James E. Blair Date: Fri Jun 8 19:31:36 2012 -0700 Switch pyflakes builder to use tox. Change-Id: Id7e2acbe86ec6b0c808778662fd6df9231bb83c3 modules/builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 09ff59c225b3ae30917773fc63481422474685b8 Author: James E. Blair Date: Fri Jun 8 09:07:17 2012 -0700 Remove check jobs. Zuul runs gate jobs and votes differently. Change-Id: Id0a8df6b565cf33a0074b68f4a7aaa4722a7e2a3 templates/python_jobs.yml | 121 --------------------------------------------- 1 file changed, 121 deletions(-) commit 5d5570b34cca67edf561c543dfd2fe9ce099f603 Author: James E. Blair Date: Fri Jun 8 08:45:04 2012 -0700 Move the rest of the jobs to precise. Change-Id: Ieec6746daf573f937f5b9c98f8724931488dd110 projects/openstack/cinder.yml | 2 +- projects/openstack/devstack-gate.yml | 2 +- projects/openstack/devstack.yml | 2 +- projects/openstack/gerrit.yml | 8 ++++---- projects/openstack/glance.yml | 2 +- projects/openstack/horizon.yml | 2 +- projects/openstack/keystone.yml | 2 +- projects/openstack/melange.yml | 2 +- projects/openstack/openstack-ci-puppet.yml | 4 ++-- projects/openstack/pypi-mirror.yml | 4 ++-- projects/openstack/python-cinderclient.yml | 2 +- projects/openstack/python-glanceclient.yml | 2 +- projects/openstack/python-keystoneclient.yml | 2 +- projects/openstack/python-melangeclient.yml | 2 +- projects/openstack/python-novaclient.yml | 2 +- projects/openstack/python-openstackclient.yml | 2 +- projects/openstack/python-quantumclient.yml | 2 +- projects/openstack/python-swiftclient.yml | 2 +- projects/openstack/quantum.yml | 2 +- projects/openstack/tempest.yml | 4 ++-- projects/openstack/zuul.yml | 6 +++--- 21 files changed, 29 insertions(+), 29 deletions(-) commit 5a283e81b101a5ca5c24a71ba09abdc794958728 Merge: ae0fd3c a765f85 Author: Jenkins Date: Thu Jun 7 23:38:52 2012 +0000 Merge "Add tempest to job filler/zuul." commit ae0fd3ca53b3254299590e3b51d42a44fc77ba71 Merge: 2cee4d8 b9aa05d Author: Jenkins Date: Thu Jun 7 22:48:56 2012 +0000 Merge "Publish xunit test results for unittests jobs." commit b9aa05d15ddc3e0c9cbaa770cdc6b579b04ef5fc Author: Monty Taylor Date: Thu Jun 7 17:36:53 2012 -0400 Publish xunit test results for unittests jobs. Change-Id: I2cd0694c073ad78f1cc94bb19b94a450ac51d00d modules/publisher_junit.py | 33 +++++++++++++++++++++++++++++++++ templates/python_jobs.yml | 20 ++++++++++++++++---- 2 files changed, 49 insertions(+), 4 deletions(-) commit 2cee4d89feac66cae7eb33016dd6dc90a9b19aa3 Author: James E. Blair Date: Thu Jun 7 13:51:05 2012 -0700 Start moving to precise. Pin the python2.6 tests to oneiric slaves because precise does not have python2.6. Switch nova and swift to precise (I have verified their unit test jobs pass on precise). Change-Id: I511d4ae78586f14bd69cd3dbd1311d05bfd58b7d projects/openstack/nova.yml | 2 +- projects/openstack/swift.yml | 2 +- templates/python_jobs.yml | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) commit a765f859a463cf44c9c94b2dec7da511c0e3ad8e Author: James E. Blair Date: Wed Jun 6 09:59:11 2012 -0700 Add tempest to job filler/zuul. Change-Id: Ie39bc8377c909328eb6da581412bda6067c56bef projects/openstack/tempest.yml | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) commit 154bae026d6cb7fa0e9e6fe83fd23029a2d7e40a Author: Julien Danjou Date: Wed Jun 6 11:07:41 2012 +0200 Add py26-essex and py27-essex jobs to ceilometer Change-Id: I2c7e3e803282e0e5078a4d0919cd4bcd0baebd9d Signed-off-by: Julien Danjou modules/builders.py | 6 +++ projects/stackforge/ceilometer.yml | 92 ++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) commit 38d328fbfc0c10cf6a0f2395aa0c6a088a7ab45d Author: James E. Blair Date: Mon Jun 4 12:12:19 2012 -0700 Switch all jobs to Zuul. Change-Id: I8b15bec5e3e936e4a698737cf86354dd91a7850c projects/openstack/devstack-gate.yml | 44 +++++++ projects/openstack/devstack.yml | 44 +++++++ templates/python_jobs.yml | 235 ++++++++++++++-------------------- 3 files changed, 185 insertions(+), 138 deletions(-) commit 0cb2ea5f289ab32915a8167db084f3e50d11d006 Author: James E. Blair Date: Fri Jun 1 16:27:37 2012 -0700 Switch openstack-ci-puppet to zuul. Change-Id: I83454ac4e337550b01a92b607c0a2fbc549596c3 projects/openstack/openstack-ci-puppet.yml | 64 ++++++++++++++++------------ 1 file changed, 36 insertions(+), 28 deletions(-) commit d3ecb4122b90c783c6e4990f4703c707be898238 Author: James E. Blair Date: Fri Jun 1 15:43:38 2012 -0700 Add openstack-ci-puppet to job filler. Added as gerrit trigger, to help test trigger->zuul migration. Change-Id: I8b4a4022fe659fe8ac98558ad0a806a403c029aa modules/builders.py | 8 +++ projects/openstack/openstack-ci-puppet.yml | 81 ++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) commit 9654c1dd178d59dff686af85cf3f46e9cc1236a4 Author: James E. Blair Date: Fri Jun 1 11:14:32 2012 -0700 Add post-merge queue. Make gerrit-package a post-merge job. Change-Id: Iac3b62a3e81a28465baa16bfbc99e4bc9cb90446 projects/openstack/gerrit.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) commit c4ef71decffee1555a4a93afba038ca8e45ca194 Author: Andrew Hutchings Date: Fri Jun 1 15:53:13 2012 +0100 Disable scm when gerrit-git-prep in use Don't use github scm when using gerrit-git-prep Will require me manually going in and clearing workspaces Fixes #1006636 Change-Id: If03633d2d37ad3219f81eb5e75649b4ccfa1a57c templates/python_jobs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 8ea72464f556b57d8e8ca4e994c05fa13704361c Author: James E. Blair Date: Thu May 31 14:41:23 2012 -0700 Switch gerrit repo to zuul. Change-Id: I22a6de6b91d78e15c5e6d17c0e34ecb80218303b projects/openstack/gerrit.yml | 151 +++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 90 deletions(-) commit 3d8082f640afd387c065a47d92aa89f3275fdd36 Author: Monty Taylor Date: Wed May 30 12:16:02 2012 -0400 Add pypi-mirror to jobs config. Change-Id: I722e5cbd2446c0837364392e0c5c08a444c2c75f projects/openstack/pypi-mirror.yml | 89 ++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) commit 38ff32c241ff363d7adb2bb1e999eae5062af3fd Merge: 17bb5ef 4a97123 Author: Jenkins Date: Thu May 31 14:32:40 2012 +0000 Merge "Add support for maven jobs." commit 17bb5ef22c8076b9e37916124b89f88af0113e41 Author: James E. Blair Date: Wed May 30 16:39:27 2012 -0700 Allow check jobs to run in parallel. Change-Id: Iad49afd3910d072691b3aabed6fc1078efcd5f86 templates/python_jobs.yml | 4 ++++ 1 file changed, 4 insertions(+) commit 4a97123a4e2c40af92b253a2f65da211cba41a2c Author: Monty Taylor Date: Wed May 30 14:56:28 2012 -0400 Add support for maven jobs. Add a project module type with some special case rules so that the general case does not have to add one to its yaml files. Change-Id: Id110e79c34fa3982275f549d017adb03a1faf473 jenkins_jobs.py | 25 +++++++++++++------ modules/builders.py | 17 ++++++++++--- modules/project_maven.py | 54 +++++++++++++++++++++++++++++++++++++++++ projects/openstack/gerrit.yml | 50 +++++++++++++++++++++++++++++++------- 4 files changed, 127 insertions(+), 19 deletions(-) commit 7e45ca078b0f91019cc0559766374aeef982bf92 Author: James E. Blair Date: Wed May 30 11:18:38 2012 -0700 Update zuul job params Change-Id: I1563e429d10b5bbcb8a742a3bec664465ccbdbb9 projects/openstack/zuul.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) commit f3d41836db6db8ce7d5422f5deab8e2e84547281 Author: Andrew Hutchings Date: Wed May 30 18:57:06 2012 +0100 Switch stackforge to oneiric Turns out Precise doesn't have Python 2.6 Change-Id: I309c3e588cad1c6dba955c3a71b28100be6a21b5 projects/stackforge/ceilometer.yml | 2 +- projects/stackforge/heat.yml | 2 +- projects/stackforge/mraas.yml | 4 ++-- projects/stackforge/reddwarf.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) commit 45c997090a701fcda31cd7f8c47fa8c1f5733623 Author: Monty Taylor Date: Wed May 30 13:33:58 2012 -0400 Put the publisher info in the right section. Change-Id: I81be23d6fa7d39b543770c17ebac30710d4a77ef projects/openstack/gerrit.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 80c06435d232947ceb1c699f4c6c44fbf5906c09 Merge: d439163 8eaca35 Author: Jenkins Date: Wed May 30 17:13:18 2012 +0000 Merge "Switch stackforge jobs to precise builders" commit d43916351db4ee0e238710f73a6e1b474e9765ea Author: Monty Taylor Date: Wed May 30 12:55:00 2012 -0400 Publish wars from unittests. Change-Id: I08214d906886435359a37bb28d1910e4d9fb7ef0 projects/openstack/gerrit.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 20c662ea882e58d57340ae1c9c086045190ea470 Author: James E. Blair Date: Wed May 30 09:43:53 2012 -0700 Change zuul endpoint port Change-Id: Ia5b24c31de4334aa7e36c4c082737f1a985f7554 projects/openstack/zuul.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 95d5ee24cbfd5179ae987b662e9479ddd8304278 Author: James E. Blair Date: Wed May 30 09:25:41 2012 -0700 Add missing zuul parameters Change-Id: I41e8eb35b34a7566e94ece4d144675faf6c93ba3 projects/openstack/zuul.yml | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) commit 8eaca35e7970dfdb0938a616d373c121e7e4ec7e Author: Andrew Hutchings Date: Wed May 30 13:12:14 2012 +0100 Switch stackforge jobs to precise builders As part of the migration of Stackforge onto the new cloud account this moves Stackforge jobs to the new precise builders (which are on the new account). Change-Id: I26a003c98b46e40d2e73c59655d78e45181a64a2 projects/openstack/cinder.yml | 1 + projects/openstack/glance.yml | 1 + projects/openstack/horizon.yml | 1 + projects/openstack/keystone.yml | 1 + projects/openstack/melange.yml | 1 + projects/openstack/nova.yml | 1 + projects/openstack/python-cinderclient.yml | 1 + projects/openstack/python-glanceclient.yml | 1 + projects/openstack/python-keystoneclient.yml | 1 + projects/openstack/python-melangeclient.yml | 1 + projects/openstack/python-novaclient.yml | 1 + projects/openstack/python-openstackclient.yml | 1 + projects/openstack/python-quantumclient.yml | 1 + projects/openstack/python-swiftclient.yml | 1 + projects/openstack/quantum.yml | 1 + projects/openstack/swift.yml | 1 + projects/stackforge/ceilometer.yml | 1 + projects/stackforge/heat.yml | 1 + projects/stackforge/mraas.yml | 4 ++-- projects/stackforge/reddwarf.yml | 1 + templates/python_jobs.yml | 24 ++++++++++++------------ 21 files changed, 33 insertions(+), 14 deletions(-) commit d0570c6b32945ff6a8758b7c43888b877ecd9196 Author: James E. Blair Date: Wed May 30 00:39:42 2012 +0000 Add Zuul jobs. Change-Id: Ib9b0bfcb843713e5df441fbd8c0f0ba7d58e07ae jenkins_jobs.py | 5 +- modules/builders.py | 3 ++ modules/properties.py | 40 +++++++++++++++ projects/openstack/zuul.yml | 116 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+), 1 deletion(-) commit 8b46e64e9566378bf610c5b033b2afbaf956f152 Author: Andrew Hutchings Date: Tue May 29 19:11:04 2012 +0100 Upgrade ceilometer to have all common jobs Change-Id: I40966bab9f8a3e338ad2a4babde3deb377298e0f projects/stackforge/ceilometer.yml | 81 +++--------------------------------- 1 file changed, 5 insertions(+), 76 deletions(-) commit b3ee4cc063259382c72efd897d15f50c97da5adc Merge: 6ab4018 2d195da Author: Jenkins Date: Tue May 29 18:09:25 2012 +0000 Merge "Add horizon and melange." commit 6ab40186aa69a6ebc77769e68b8254d8da64ac03 Author: Monty Taylor Date: Tue May 29 14:00:31 2012 -0400 Change gerrit jobs to use tools/release.sh Change-Id: I90f0afb8edf251484e9bf018478150f209dad163 projects/openstack/gerrit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1827c1925d9f5759f970fe12b3ca343d6810af8f Author: Monty Taylor Date: Tue May 29 13:15:05 2012 +0000 Revert "Fix tarball jobs" Fixes 1005877. Also, an empty master file was put in refs/meta/openstack/release so that the old NOMILESTONE logic should work without weirdness now. This reverts commit b838629877b12fa044ce237e003b9d81a88bc9d2 and 1bfc9b22fdd1b1a275e1ac7a4e773c9cb8f41ba7 - except for the builders.py change. Change-Id: I03e02b54e8f13dccd71cc7ec5fdf5d77fa4f42c4 modules/builders.py | 4 - projects/openstack/swift.yml | 483 +----------------------------------------- 2 files changed, 5 insertions(+), 482 deletions(-) commit f676e424902b50c166b394c5e5f2a37035d4729e Author: Andrew Hutchings Date: Tue May 29 10:14:34 2012 +0100 Fix NOMILESTONE Change-Id: I709083ca79c9627faa5a4222f3fdf6ce5a473803 modules/builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 866b235887324504bae024a2135818db2bc37f0a Author: Andrew Hutchings Date: Tue May 29 10:05:59 2012 +0100 Fix tarball jobs * Don't use github scm for tarball * Add NOMILESTONE hack for swift (fixes bug #1005811) Change-Id: I3e91f865d8a980f9ec19542290a3c7feaf260914 modules/builders.py | 4 + projects/openstack/swift.yml | 483 +++++++++++++++++++++++++++++++++++++++++- templates/python_jobs.yml | 2 +- 3 files changed, 483 insertions(+), 6 deletions(-) commit 48acfb1ddba75c7935e50aa50263f4f86c1c540b Merge: 604f2e5 96d3187 Author: Jenkins Date: Sun May 27 15:41:18 2012 +0000 Merge "Add support for jobs to build gerrit." commit 604f2e5795e0f3cc129a4112e9855fc1c705b1b8 Merge: 6c59920 fe7195e Author: Jenkins Date: Sun May 27 15:39:41 2012 +0000 Merge "Finish removing ppa jobs." commit 6c59920137e0344fe3e0c58c07ff2c4c000c300c Author: Andrew Hutchings Date: Sun May 27 16:34:01 2012 +0100 Fix name off-by-one Job names were off-by-one Change-Id: I0f3a9936b543189ca073e4559084f400eeae2a1a jenkins_jobs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 2d195da0f504675dfc8be9e49e903ea06c3cb9b2 Author: Monty Taylor Date: Sun May 27 10:17:21 2012 -0400 Add horizon and melange. This should not go in until the corresponding change lands to horizon: https://review.openstack.org/#/c/7827/ Which gets horizon on board with what we need. Change-Id: Ia365dd806d424abf616f9cf6e1cb5aa0e0230ad7 projects/openstack/horizon.yml | 9 +++++++++ projects/openstack/melange.yml | 9 +++++++++ projects/openstack/python-melangeclient.yml | 9 +++++++++ 3 files changed, 27 insertions(+) commit 96d3187fba0aaf49ae2e18569b9af4407acec54c Author: Monty Taylor Date: Sat May 26 12:46:30 2012 -0400 Add support for jobs to build gerrit. Change-Id: I3d244ed76c153ae2d23afb4f7ba7198f3c92ac08 modules/builders.py | 10 ++ modules/publisher_war.py | 41 ++++++++ projects/openstack/gerrit.yml | 212 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+) commit fe7195e7e27032e391fc46c2368af4631b19dd37 Author: Monty Taylor Date: Sun May 27 10:19:04 2012 -0400 Finish removing ppa jobs. The tarball job had a post-build trigger on the ppa job. That's certainly no longer needed. Change-Id: I915c11ffff48a0667c5d2a644e3cdff87dbe41d0 modules/publisher_tarball.py | 10 ---------- 1 file changed, 10 deletions(-) commit e250e0034f3c6ccbcd73ca13bc57a4ad9c034c93 Merge: 6baebbf 4ed6abb Author: Jenkins Date: Sun May 27 13:11:33 2012 +0000 Merge "Fix YAML parsing" commit 6baebbfec169ac2296247cb4346a8900ee0b56f1 Author: Monty Taylor Date: Sun May 20 12:35:01 2012 -0400 Added the rest of the openstack projects. Except for horizon. Because it's different. Change-Id: Ifdf9d8624b1faf6e6fbb23bea549167282fb29b8 projects/openstack/glance.yml | 9 +++++++++ projects/openstack/keystone.yml | 9 +++++++++ projects/openstack/nova.yml | 9 +++++++++ projects/openstack/quantum.yml | 9 +++++++++ projects/openstack/swift.yml | 9 +++++++++ 5 files changed, 45 insertions(+) commit 4ed6abb2cd4ad6aff1e3bb44f39919febd2813bf Author: Andrew Hutchings Date: Fri May 25 18:04:55 2012 +0100 Fix YAML parsing * When not using template don't skip the first job (fixes bug #1004575) * Allow multiple templates or a mix of templates and single jobs in a project YAML Change-Id: I2dffa75c3fde2e7061886ffd879958933a150798 jenkins_jobs.py | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) commit 948aedb27eae792eccd6bab25493984310bd7c18 Merge: 7bd2c21 e1d4f26 Author: Jenkins Date: Fri May 25 16:51:23 2012 +0000 Merge changes I76ad015e,Iabe17164 * changes: Add pyflakes to Jekins slaves Make all Python pass pyflakes commit 7bd2c2178fad9a34e5c57d3f258dc0b9c0be5fc5 Merge: 7fedd6b 2025cd9 Author: Jenkins Date: Fri May 25 15:52:12 2012 +0000 Merge "Stackforge Jenkins Jobs changes" commit 7fedd6b870844fb15537513ecce55ca2796f12d0 Merge: 5034868 acc4552 Author: Jenkins Date: Fri May 25 15:39:00 2012 +0000 Merge "Disable ppa jobs." commit e1d4f26faaa470c27b022edd82b7581c239dd9ad Author: Andrew Hutchings Date: Fri May 25 14:26:41 2012 +0100 Make all Python pass pyflakes This found one bug, but will also help us with Jenkins testing of these scripts Change-Id: Iabe171645c06f769957db7cf0def1d10a0e47988 jenkins_jobs.py | 2 -- modules/publisher_tarball.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) commit 2025cd99f04521d08e78ccfff24bec2f34d06165 Author: Andrew Hutchings Date: Fri May 25 13:50:02 2012 +0100 Stackforge Jenkins Jobs changes * Add MRaaS to Jenkins Jobs (last Stackforge project to do so, yay!) * Heat can now use the python jobs template, so switching to that Change-Id: I5abff387ce7967a39ffd830f2c0086f95bbeed74 projects/stackforge/heat.yml | 480 +---------------------------------------- projects/stackforge/mraas.yml | 80 +++++++ 2 files changed, 85 insertions(+), 475 deletions(-) commit 5034868677c74fc9ae5c80c3102aea7d575aa0dc Author: James E. Blair Date: Thu May 24 16:42:34 2012 +0000 Support dependent changes in gerrit-git-prep. Also added full hostname support to gerrit-git-prep -- 'review.openstack.org' instead of 'openstack'. This means it can be used with 'review-dev.openstack.org' for instance. Updated the jenkins job filler to use a 'review_site' parameter to facilitate that. Updated the jenknis jobs filler to use slightly different variables review_site github_org publisher_site which are more explicit about their purpose than 'site' and 'host'. Make the docs/tarball publishers require a site param. Change-Id: If24be8f7a74c09b215f94d371d5f09a695e2c098 jenkins_jobs.py | 34 ++++++++++---- modules/builders.py | 6 +-- modules/properties.py | 2 +- modules/publisher_docs.py | 6 ++- modules/publisher_tarball.py | 17 +++---- modules/scm.py | 2 +- projects/openstack/cinder.yml | 4 +- projects/openstack/python-cinderclient.yml | 4 +- projects/openstack/python-glanceclient.yml | 4 +- projects/openstack/python-keystoneclient.yml | 4 +- projects/openstack/python-novaclient.yml | 4 +- projects/openstack/python-openstackclient.yml | 4 +- projects/openstack/python-quantumclient.yml | 4 +- projects/openstack/python-swiftclient.yml | 4 +- projects/stackforge/ceilometer.yml | 6 ++- projects/stackforge/heat.yml | 48 ++++++++++--------- projects/stackforge/reddwarf.yml | 5 +- templates/python_jobs.yml | 62 ++++++++++++++++--------- 18 files changed, 136 insertions(+), 84 deletions(-) commit acc4552475553d7811b76c0433be0883be26572d Author: Monty Taylor Date: Thu May 24 12:41:08 2012 -0400 Disable ppa jobs. Change-Id: Ic2ce77f0b95bb67b6c7c8d75eb31bbc1db407004 templates/python_jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 86aead0ba0de7fa5edda36bb8572b74f29703f00 Author: Andrew Hutchings Date: Tue May 22 19:53:22 2012 +0100 Fix is_job call is_job is a local method Change-Id: Ibef717ee5b8b3465dac185dc0cb5bb4f895bad29 jenkins_jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 620193e23b0bf53b37f1c7efafa7ada3890062b2 Author: Andrew Hutchings Date: Tue May 22 19:43:05 2012 +0100 Fix Jenkins Jobs for Heat Gerrit git prep uses 'site' to determine Gerrit URL. For heat we use 'heat-api' for 'site'. This adds a new parameter called 'host' which we can set to 'stackforge' for Heat Change-Id: I7d82119b70efbea4f12eadcb6e77cfcabef84c7e modules/builders.py | 6 +- projects/stackforge/heat.yml | 473 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 474 insertions(+), 5 deletions(-) commit 4a9844f61c10f3fb8d5427ae4cd5c53725a0f2ea Merge: 74c9feb 214cbb5 Author: Jenkins Date: Tue May 22 15:37:08 2012 +0000 Merge "Port job_filler to python-jenkins." commit 74c9feb924acfa5a3d874d1f6f0b3ed7d66404c5 Author: Andrew Hutchings Date: Tue May 22 13:13:41 2012 +0100 Move to sync with heat-api/heat on github Change-Id: Id81af494394b08ef34a00820a68244ea9cc0436b projects/stackforge/heat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 33291aba30f97810c55b328b583f7d8f5c7ef0ad Author: Andrew Hutchings Date: Mon May 21 15:48:34 2012 +0100 Fix key errors Change-Id: Idd11a8177a96c3042e189f7acf2d9204ebe71a36 modules/builders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0bfc302a65ef1a63de6014b9f69fc34133ce276a Author: Andrew Hutchings Date: Mon May 21 15:44:46 2012 +0100 Check key exists before testing if it is true Change-Id: Ief6bdc0c96a477c72b1ad468198fcd033debac33 modules/trigger_gerrit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7341397c63522d10fafccc2c31d8345f6e9662ff Author: Andrew Hutchings Date: Mon May 21 15:35:06 2012 +0100 Don't use copy_bundle builder since it is now gone Change-Id: I3ad02ae6c85e6be705a5e06d9a1f130f9652062a templates/python_jobs.yml | 9 --------- 1 file changed, 9 deletions(-) commit 43a1ee70cbc3935b3a01d9b61d40d384c1f369c3 Author: Andrew Hutchings Date: Mon May 21 15:24:15 2012 +0100 Fix Jenkins Jobs XML and missing package Change-Id: Idcc8e75cdfdef1dd4d9b4ee7fb2e4f5247cf1e9f modules/properties.py | 5 ----- 1 file changed, 5 deletions(-) commit eabafe3b3eaf25043746d845be98a59341b056e8 Merge: 4616a42 c1f6ea7 Author: Jenkins Date: Mon May 21 13:43:28 2012 +0000 Merge "Add merge-check to Ceilometer" commit 4616a426354fb5f4249b4fa9c09baf00d9e7e941 Author: Monty Taylor Date: Thu May 17 17:08:08 2012 -0400 Remove venv jobs. Change-Id: I61e798c12e78fdf8394394668df1536cc6797246 modules/builders.py | 16 +++------------- modules/properties.py | 4 ---- modules/publisher_venv.py | 29 ----------------------------- templates/python_jobs.yml | 29 ----------------------------- 4 files changed, 3 insertions(+), 75 deletions(-) commit 66bf7298cbb63718177a54c22f8d512d39c65d00 Author: Monty Taylor Date: Wed May 16 21:29:33 2012 -0400 Timed trigger and pollscm are different things. Change-Id: Ia1b9c2cd2a6be50447f0898b7a8e53d906f683d9 modules/trigger_pollscm.py | 33 +++++++++++++++++++++++++++++++++ modules/trigger_timed.py | 2 +- templates/python_jobs.yml | 12 ++++++------ 3 files changed, 40 insertions(+), 7 deletions(-) commit 0af09f8279a64a9af285bc739cfef2d9d8f4e935 Author: Monty Taylor Date: Wed May 16 12:30:58 2012 -0400 Add first openstack projects. Change-Id: Ia05591e9643e5d71e4cffe5650a310807b825b38 projects/openstack/cinder.yml | 7 +++++++ projects/openstack/python-cinderclient.yml | 7 +++++++ projects/openstack/python-glanceclient.yml | 7 +++++++ projects/openstack/python-keystoneclient.yml | 7 +++++++ projects/openstack/python-novaclient.yml | 7 +++++++ projects/openstack/python-openstackclient.yml | 7 +++++++ projects/openstack/python-quantumclient.yml | 7 +++++++ projects/openstack/python-swiftclient.yml | 7 +++++++ 8 files changed, 56 insertions(+) commit c1f6ea7684300a1d2c97ab64c539611ade6b8b3c Author: Andrew Hutchings Date: Mon May 21 14:17:41 2012 +0100 Add merge-check to Ceilometer Change-Id: If5ba611483a06721ca899c0e3ac8313b4a3f5ea7 projects/stackforge/ceilometer.yml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) commit 214cbb54b6b98142e2f2d3133d65b3b25607d113 Author: Monty Taylor Date: Sat May 19 12:00:19 2012 -0400 Port job_filler to python-jenkins. Change-Id: I151582412267414097bb411d0ab81e03247fc0a2 jenkins_jobs.py | 8 ++--- jenkins_talker.py | 86 ----------------------------------------------------- 2 files changed, 4 insertions(+), 90 deletions(-) commit 1ea96e0450138dcdd22a78ac792c11cd10d2ba7d Merge: 8cc7d28 993a4ec Author: Jenkins Date: Thu May 17 16:07:54 2012 +0000 Merge "Add support for overriding verify votes." commit 8cc7d285d9df3e7f75d206b67a53084f0f87589f Author: Andrew Hutchings Date: Thu May 17 11:25:11 2012 +0100 Add heat project to Stackforge Change-Id: I6ad250761c724400ff48cae13509e5f770d14e0b projects/stackforge/heat.yml | 8 ++++++++ 1 file changed, 8 insertions(+) commit 993a4ecff1a68353125c7ba62c607e7ece4067d1 Author: Monty Taylor Date: Wed May 16 12:31:36 2012 -0400 Add support for overriding verify votes. Change-Id: I726dac8fe53539c92459d770de088d4bcd8c9dfc modules/trigger_gerrit.py | 6 ++++++ templates/python_jobs.yml | 12 ++++++++++++ 2 files changed, 18 insertions(+) commit f26aefe89c1e11391e077b2753b0b0b31adc9998 Author: Andrew Hutchings Date: Wed May 16 16:16:26 2012 +0100 Jenkins Job Builder 2.2 Adds support for project templates Fixes a dep issue in Ubuntu Switch off debug print in jenkins_talker.py Fix pep8-check job Remove dep on PyXML Remove pretty printing (probably not needed anyway) Change-Id: Id14d65674b7ab080df566fa31f2d4d5f88986e9d jenkins_jobs.py | 25 +- jenkins_talker.py | 1 - projects/stackforge/reddwarf.yml | 489 +------------------------------------ templates/python_jobs.yml | 490 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 511 insertions(+), 494 deletions(-) commit 1cff3e6f5a17545d856f0d3c26a03d03e637a612 Author: Andrew Hutchings Date: Mon May 14 20:10:00 2012 +0100 Version 2.1 of Jenkins Jobs Builder * Adds delete support * Adds check-* job support Change-Id: Ia7a19cebd32cb348e26b086353a8b5225e1e5837 jenkins_jobs.py | 48 ++++++++---- jenkins_talker.py | 8 +- modules/trigger_gerrit.py | 7 +- projects/stackforge/reddwarf.yml | 160 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 202 insertions(+), 21 deletions(-) commit 1216b8ec008e4050d761c851f08710559014cd9a Author: Andrew Hutchings Date: Wed May 9 14:28:53 2012 +0100 Jenkins Job builder 2.0 This uses a python script with modules for parts of the XML. The parameters for the projects are provided using YAML scripts. It also includes a Jenkins API module to directly inject jobs into Jenkins without requiring a restart/reload as well as a memory of which jobs have been pushed to Jenkins. It is currently configured to replace the original Jenkins Jobs in StackForge. What it won't yet do: 1. Delete jobs (although it isn't far off being able to) 2. check-* jobs (need to modify the trigger_gerrit module to support that) Documentation to follow Fixes bug #995599 Change-Id: I2a67ee2d9e8f43cbced56425ef7f80dc6a30a814 jenkins_jobs.py | 173 +++++++++++++++++++ jenkins_talker.py | 83 +++++++++ modules/assignednode.py | 31 ++++ modules/builders.py | 83 +++++++++ modules/logrotate.py | 41 +++++ modules/properties.py | 49 ++++++ modules/publisher_coverage.py | 63 +++++++ modules/publisher_docs.py | 43 +++++ modules/publisher_none.py | 26 +++ modules/publisher_pep8.py | 74 ++++++++ modules/publisher_ppa.py | 29 ++++ modules/publisher_tarball.py | 54 ++++++ modules/publisher_venv.py | 29 ++++ modules/scm.py | 64 +++++++ modules/trigger_gerrit.py | 70 ++++++++ modules/trigger_none.py | 26 +++ modules/trigger_timed.py | 33 ++++ projects/stackforge/ceilometer.yml | 38 +++++ projects/stackforge/reddwarf.yml | 329 ++++++++++++++++++++++++++++++++++++ 19 files changed, 1338 insertions(+)