Enable additional gate checks

Changes to murano-deployment repo should be
checked by all murano gates since they all are
dependent from scripts placed in murano-deployment
repository.
 This commit achieves this by adding
set_params function which does next:
 - launches gate-murano-* jobs on master branch
 - sets MURANO_DEPLOYMENT_REF parameter to
   ref of needed murano-deployment change for gate-murano-*
   jobs

Change-Id: I11a877569d793dc4d6f80fa09645facc605ec3d0
This commit is contained in:
Mykyta Karpin 2016-07-18 16:49:41 +03:00
parent 94e332d5ff
commit 685fc2c560
3 changed files with 47 additions and 9 deletions

View File

@ -1,5 +1,5 @@
- job-template:
name: 'gate-{name}-{distro}'
name: 'gate-{name}-{distro}{job-suffix}'
project-type: freestyle
defaults: global
description: '{name} {distro} gate job'
@ -132,21 +132,27 @@
- project:
name: murano
distro: ubuntu
job-suffix:
- ''
- '-nv'
repository: openstack/murano
tests: 'gate'
jobs:
- 'hook-{name}-rtfd'
- 'gate-{name}-{distro}'
- 'gate-{name}-{distro}{job-suffix}'
- 'heartbeat-{name}-{distro}'
- 'coverage-{name}-{distro}'
- project:
name: murano-dashboard
distro: ubuntu
job-suffix:
- ''
- '-nv'
repository: openstack/murano-dashboard
tests: ''
jobs:
- 'gate-{name}-{distro}'
- 'gate-{name}-{distro}{job-suffix}'
- 'heartbeat-{name}-{distro}'
- project:
@ -154,16 +160,22 @@
distro:
- ubuntu
- debian
job-suffix:
- ''
- '-nv'
repository: openstack/murano-agent
tests: 'gate'
jobs:
- 'gate-{name}-{distro}'
- 'gate-{name}-{distro}{job-suffix}'
- 'heartbeat-{name}-{distro}'
- project:
name: murano-client
distro: ubuntu
job-suffix:
- ''
- '-nv'
repository: openstack/python-muranoclient
tests: ''
jobs:
- 'gate-{name}-{distro}'
- 'gate-{name}-{distro}{job-suffix}'

View File

@ -50,12 +50,20 @@ projects:
- name: openstack/murano-deployment
check:
- gate-murano-deployment
- gate-murano-ubuntu-nv
- gate-murano-dashboard-ubuntu-nv
- gate-murano-agent-ubuntu-nv
- gate-murano-client-ubuntu-nv
- coverage-murano-ubuntu
jobs:
- name: ^.*$
parameter-function: single_use_node
- name: ^gate-.*$
voting: true
parameter-function: set_params
# -nv jobs are never voting.
- name: ^.*-nv$
voting: false
- name: ^coverage-.*$
voting: false
- name: ^gate-murano-agent-debian$
voting: false
- name: ^gate-murano-deployment$

View File

@ -11,6 +11,7 @@
# 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 re
def set_log_url(item, job, params):
@ -31,4 +32,21 @@ def set_log_url(item, job, params):
def single_use_node(item, job, params):
set_log_url(item, job, params)
params['OFFLINE_NODE_WHEN_COMPLETE'] = '1'
params['OFFLINE_NODE_WHEN_COMPLETE'] = '1'
def set_params(item, job, params):
single_use_node(item, job, params)
# every time we are changing murano-deployment, we need to run
# other dependent jobs with this change to be sure they are not broken
if params['ZUUL_PROJECT'] == 'openstack/murano-deployment':
if job.name != 'gate-murano-deployment':
if 'murano-client' in job.name:
project_name = 'python-muranoclient'
else:
project_name = re.sub("^\w+-|-\w+$|-\w+-nv|-nv", '', job.name)
deployment_ref = params['ZUUL_CHANGES'].rpartition(':')[2]
params['MURANO_DEPLOYMENT_REF'] = deployment_ref
params['ZUUL_REF'] = params.get('ZUUL_BRANCH', 'master')
params['ZUUL_URL'] = 'https://git.openstack.org'
params['ZUUL_PROJECT'] = "openstack/%s" % project_name