diff --git a/modules/jenkins_jobs/files/modules/zuul.py b/modules/jenkins_jobs/files/modules/zuul.py new file mode 100644 index 0000000000..20bc44daa9 --- /dev/null +++ b/modules/jenkins_jobs/files/modules/zuul.py @@ -0,0 +1,77 @@ +#! /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. + +# Jenkins Job module for Zuul + +ZUUL_PARAMETERS = [ + {'description': 'Zuul provided key to link builds with Gerrit events', + 'name': 'UUID', + 'type': 'string'}, + {'description': 'Zuul provided project name', + 'name': 'GERRIT_PROJECT', + 'type': 'string'}, + {'description': 'Zuul provided branch name', + 'name': 'GERRIT_BRANCH', + 'type': 'string'}, + {'description': 'Zuul provided list of dependent changes to merge', + 'name': 'GERRIT_CHANGES', + 'type': 'string'} + ] + +ZUUL_POST_PARAMETERS = [ + {'description': 'Zuul provided key to link builds with Gerrit events', + 'name': 'UUID', + 'type': 'string'}, + {'description': 'Zuul provided project name', + 'name': 'GERRIT_PROJECT', + 'type': 'string'}, + {'description': 'Zuul provided ref name', + 'name': 'GERRIT_REFNAME', + 'type': 'string'}, + {'description': 'Zuul provided old reference for ref-updated', + 'name': 'GERRIT_OLDREV', + 'type': 'string'}, + {'description': 'Zuul provided new reference for ref-updated', + 'name': 'GERRIT_NEWREV', + 'type': 'string'} + ] + +ZUUL_NOTIFICATIONS = [ + {'URL': 'http://127.0.0.1:8001/jenkins_endpoint', + 'protocol': 'HTTP'} + ] + +class zuul(object): + def __init__(self, data): + self.data = data + self._update() + + def _update(self): + data = self.data + if ('zuul' not in data.get('triggers', []) and + 'zuul_post' not in data.get('triggers', [])): + return + if 'parameters' not in data: + data['parameters'] = [] + if 'notification_endpoints' not in data: + data['notification_endpoints'] = [] + data['notification_endpoints'].extend(ZUUL_NOTIFICATIONS) + if 'zuul' in data.get('triggers', []): + data['parameters'].extend(ZUUL_PARAMETERS) + if 'zuul_post' in data.get('triggers', []): + data['parameters'].extend(ZUUL_POST_PARAMETERS) + + def gen_xml(self, xml_parent): + pass diff --git a/modules/jenkins_jobs/files/projects/openstack/devstack-gate.yml b/modules/jenkins_jobs/files/projects/openstack/devstack-gate.yml index c094bedcc4..6a1ed70939 100644 --- a/modules/jenkins_jobs/files/projects/openstack/devstack-gate.yml +++ b/modules/jenkins_jobs/files/projects/openstack/devstack-gate.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-devstack-gate-merge' @@ -14,23 +15,8 @@ main: project: 'devstack-gate' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/openstack/devstack.yml b/modules/jenkins_jobs/files/projects/openstack/devstack.yml index cda387b4ab..be0da442c3 100644 --- a/modules/jenkins_jobs/files/projects/openstack/devstack.yml +++ b/modules/jenkins_jobs/files/projects/openstack/devstack.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-devstack-merge' @@ -14,23 +15,8 @@ main: project: 'devstack' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/openstack/gerrit.yml b/modules/jenkins_jobs/files/projects/openstack/gerrit.yml index 04f738c79a..742c3d19da 100644 --- a/modules/jenkins_jobs/files/projects/openstack/gerrit.yml +++ b/modules/jenkins_jobs/files/projects/openstack/gerrit.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-gerrit-merge' @@ -15,23 +16,8 @@ main: authenticatedBuild: 'true' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -51,6 +37,7 @@ modules: - assignednode - builders:prebuilders - publishers + - zuul main: name: 'check-gerrit-unittests' @@ -60,23 +47,8 @@ main: authenticatedBuild: 'true' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul prebuilders: - gerrit_git_prep @@ -113,6 +85,7 @@ modules: - builders:prebuilders - builders:postbuilders - publishers + - zuul main: name: 'gate-gerrit-unittests' @@ -122,23 +95,8 @@ main: authenticatedBuild: 'true' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul prebuilders: - gerrit_git_prep @@ -169,6 +127,7 @@ modules: - builders:prebuilders - builders:postbuilders - publishers + - zuul main: name: 'gerrit-package' @@ -178,26 +137,8 @@ main: authenticatedBulid: 'false' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_REFNAME - type: string - description: Zuul provided ref name - - name: GERRIT_OLDREV - type: string - description: Zuul provided old reference for ref-updated - - name: GERRIT_NEWREV - type: string - description: Zuul provided new reference for ref-updated - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul_post prebuilders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/openstack/openstack-ci-puppet.yml b/modules/jenkins_jobs/files/projects/openstack/openstack-ci-puppet.yml index 53f4619f7b..2e26a6815d 100644 --- a/modules/jenkins_jobs/files/projects/openstack/openstack-ci-puppet.yml +++ b/modules/jenkins_jobs/files/projects/openstack/openstack-ci-puppet.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-ci-puppet-merge' @@ -14,23 +15,8 @@ main: project: 'openstack-ci-puppet' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -49,6 +35,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-ci-puppet-syntax' @@ -57,23 +44,8 @@ main: project: 'openstack-ci-puppet' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/openstack/pypi-mirror.yml b/modules/jenkins_jobs/files/projects/openstack/pypi-mirror.yml index 4f3f24d6bd..27a32e2c17 100644 --- a/modules/jenkins_jobs/files/projects/openstack/pypi-mirror.yml +++ b/modules/jenkins_jobs/files/projects/openstack/pypi-mirror.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-pypi-mirror-pyflakes' @@ -14,23 +15,8 @@ main: project: 'pypi-mirror' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -50,6 +36,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-pypi-mirror-merge' @@ -58,23 +45,8 @@ main: project: 'pypi-mirror' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/openstack/tempest.yml b/modules/jenkins_jobs/files/projects/openstack/tempest.yml index 5b91dc5d52..60c8ab4974 100644 --- a/modules/jenkins_jobs/files/projects/openstack/tempest.yml +++ b/modules/jenkins_jobs/files/projects/openstack/tempest.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-tempest-pep8' @@ -14,23 +15,8 @@ main: project: 'tempest' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -53,6 +39,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-tempest-merge' @@ -61,23 +48,8 @@ main: project: 'tempest' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/openstack/zuul.yml b/modules/jenkins_jobs/files/projects/openstack/zuul.yml index a3459b4190..a82c9062e4 100644 --- a/modules/jenkins_jobs/files/projects/openstack/zuul.yml +++ b/modules/jenkins_jobs/files/projects/openstack/zuul.yml @@ -6,6 +6,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-zuul-pyflakes' @@ -14,23 +15,8 @@ main: project: 'zuul' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -50,6 +36,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-zuul-pep8' @@ -58,23 +45,8 @@ main: project: 'zuul' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -97,6 +69,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-zuul-merge' @@ -105,23 +78,8 @@ main: project: 'zuul' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/projects/stackforge/ceilometer.yml b/modules/jenkins_jobs/files/projects/stackforge/ceilometer.yml index bbd320c2a0..f3eb6bad26 100644 --- a/modules/jenkins_jobs/files/projects/stackforge/ceilometer.yml +++ b/modules/jenkins_jobs/files/projects/stackforge/ceilometer.yml @@ -18,6 +18,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-ceilometeer-python26-essex' @@ -27,23 +28,8 @@ main: authenticatedBuild: 'true' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -63,6 +49,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-ceilometeer-python27-essex' @@ -73,23 +60,8 @@ main: disabled: 'false' concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep diff --git a/modules/jenkins_jobs/files/templates/python_jobs.yml b/modules/jenkins_jobs/files/templates/python_jobs.yml index b37bbcf7e8..2cce66080b 100644 --- a/modules/jenkins_jobs/files/templates/python_jobs.yml +++ b/modules/jenkins_jobs/files/templates/python_jobs.yml @@ -46,6 +46,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-@NAME@-pep8' @@ -56,23 +57,8 @@ main: disabled: @DISABLED@ concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -95,6 +81,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-@NAME@-python26' @@ -105,23 +92,8 @@ main: disabled: @DISABLED@ concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -146,6 +118,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-@NAME@-python27' @@ -156,23 +129,8 @@ main: disabled: @DISABLED@ concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -197,6 +155,7 @@ modules: - trigger_pollscm - builders - publishers + - zuul main: name: '@NAME@-docs' @@ -234,6 +193,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: 'gate-@NAME@-merge' @@ -244,23 +204,8 @@ main: disabled: @DISABLED@ concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_BRANCH - type: string - description: Zuul provided branch name - - name: GERRIT_CHANGES - type: string - description: Zuul provided list of dependent changes to merge - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul builders: - gerrit_git_prep @@ -309,6 +254,7 @@ modules: - assignednode - builders - publishers + - zuul main: name: '@NAME@-tarball' @@ -319,26 +265,8 @@ main: disabled: @DISABLED@ concurrent: 'true' -parameters: - - name: UUID - type: string - description: Zuul provided key to link builds with Gerrit events - - name: GERRIT_PROJECT - type: string - description: Zuul provided project name - - name: GERRIT_REFNAME - type: string - description: Zuul provided ref name - - name: GERRIT_OLDREV - type: string - description: Zuul provided old reference for ref-updated - - name: GERRIT_NEWREV - type: string - description: Zuul provided new reference for ref-updated - -notification_endpoints: - - protocol: HTTP - URL: http://127.0.0.1:8001/jenkins_endpoint +triggers: + - zuul_post builders: - gerrit_git_prep