Add per comment pipeline for dashboard

Change-Id: I5d34bdb0be94718de0e816a2aae3172e754e2292
This commit is contained in:
Mykyta Karpin 2016-10-06 15:33:26 +03:00
parent 22ffce6d21
commit 8154507473
5 changed files with 58 additions and 31 deletions

View File

@ -12,6 +12,9 @@
name: KEEP_VM_ALIVE
- string:
name: MURANO_DEPLOYMENT_REF
- string:
name: OVERRIDE_PROJECT
default: '{repository}'
properties:
- zeromq-event
@ -58,6 +61,9 @@
name: KEEP_VM_ALIVE
- string:
name: MURANO_DEPLOYMENT_REF
- string:
name: OVERRIDE_PROJECT
default: '{repository}'
properties:
- zeromq-event
@ -73,7 +79,6 @@
export OVERRIDE_URL=https://git.openstack.org
export OVERRIDE_BRANCH=master
export OVERRIDE_PROJECT='{repository}'
export DISTR_NAME='{distro}'
export EXECUTE_TESTS_BY_TAG='{tests}'
export SAVE_IMAGE='no' # 'yes' # Temporary workaround until Murano CI upgrade
@ -104,6 +109,9 @@
name: KEEP_VM_ALIVE
- string:
name: MURANO_DEPLOYMENT_REF
- string:
name: OVERRIDE_PROJECT
default: '{repository}'
properties:
- zeromq-event
@ -119,7 +127,6 @@
export OVERRIDE_URL=https://git.openstack.org
export OVERRIDE_BRANCH=master
export OVERRIDE_PROJECT='{repository}'
export DISTR_NAME='{distro}'
export EXECUTE_TESTS_BY_TAG='{tests}'
export WITH_COVERAGE='true'

View File

@ -23,8 +23,16 @@ STACK_HOME='/opt/stack'
ZUUL_URL=${ZUUL_URL:-'https://git.openstack.org'}
ZUUL_REF=${ZUUL_REF:-'master'}
# ZUUL_PROJECT variable indicates project which will
# be cloned from Gerrit with specified change id (refs)
ZUUL_PROJECT=${ZUUL_PROJECT:-'openstack/murano'}
# PROJECT_NAME variable indicates project which is
# actually tested
PROJECT_NAME_REAL=${OVERRIDE_PROJECT:-$ZUUL_PROJECT}
PROJECT_NAME=${PROJECT_NAME_REAL##*/}
if [[ -n "${OVERRIDE_BRANCH}" ]]; then
ZUUL_BRANCH=$OVERRIDE_BRANCH
ZUUL_REF=$OVERRIDE_BRANCH
@ -34,10 +42,6 @@ if [[ -n "${OVERRIDE_URL}" ]]; then
ZUUL_URL=$OVERRIDE_URL
fi
if [[ -n "${OVERRIDE_PROJECT}" ]]; then
ZUUL_PROJECT=$OVERRIDE_PROJECT
fi
EXECUTE_TESTS_BY_TAG=${EXECUTE_TESTS_BY_TAG:-''}
APPS_REPO=${APPS_REPO:-https://github.com/openstack/murano-apps}
@ -57,8 +61,6 @@ MURANO_DASHBOARD_BRANCH=${ZUUL_BRANCH}
MURANO_PYTHONCLIENT_REPO=${MURANO_PYTHONCLIENT_REPO:-git://git.openstack.org/openstack/python-muranoclient.git}
MURANO_PYTHONCLIENT_BRANCH=${ZUUL_BRANCH}
PROJECT_NAME=${ZUUL_PROJECT##*/}
APT_PROXY_HOST=${APT_PROXY_HOST:-''}
OPENSTACK_HOST=${OPENSTACK_HOST:-$KEYSTONE_URL}
@ -122,7 +124,7 @@ case "${PROJECT_NAME}" in
echo "No tests currently available"
;;
*)
echo "Project name '$ZUUL_PROJECT' isn't supported yet."
echo "Project name $PROJECT_NAME isn't supported yet."
exit 1
;;
esac

View File

@ -40,7 +40,7 @@ function deploy_devstack() {
sudo chown -R jenkins:jenkins "${git_dir}/openstack"
git clone https://github.com/openstack/murano "${git_dir}/openstack/murano"
if [ "${PROJECT_NAME}" == 'murano' ]; then
if [ "${ZUUL_PROJECT}" == 'openstack/murano' ]; then
pushd "${git_dir}/openstack/murano"
git fetch ${ZUUL_URL}/${ZUUL_PROJECT} ${ZUUL_REF} && git checkout FETCH_HEAD
popd
@ -67,17 +67,17 @@ function deploy_devstack() {
cd "${STACK_HOME}/devstack"
case "${PROJECT_NAME}" in
'murano')
case "${ZUUL_PROJECT}" in
'openstack/murano')
MURANO_REPO="${ZUUL_URL}/${ZUUL_PROJECT}"
MURANO_BRANCH="${ZUUL_REF}"
;;
'murano-dashboard')
'openstack/murano-dashboard')
MURANO_DASHBOARD_REPO="${ZUUL_URL}/${ZUUL_PROJECT}"
MURANO_DASHBOARD_BRANCH="${ZUUL_REF}"
APPS_REPOSITORY_URL="http://${FLOATING_IP_ADDRESS}:8099"
;;
'python-muranoclient')
'openstack/python-muranoclient')
MURANO_PYTHONCLIENT_REPO="${ZUUL_URL}/${ZUUL_PROJECT}"
MURANO_PYTHONCLIENT_BRANCH="${ZUUL_REF}"
;;

View File

@ -19,6 +19,19 @@ pipelines:
verified: -1
failure-message: To re-run the job please post a comment with `retrigger murano-ci`
- name: check_dashboard
manager: IndependentPipelineManager
trigger:
gerrit:
- event: comment-added
comment_filter: (?i)^(Patch Set [0-9]+:\n\n)?\s*(check dashboard)\s*$
success:
gerrit:
verified: 1
failure:
gerrit:
verified: -1
- name: post
description: This pipeline runs jobs that operate after each change is merged.
manager: IndependentPipelineManager
@ -33,6 +46,9 @@ projects:
check:
- gate-murano-ubuntu
- gate-murano-ubuntu-glare-nv
check_dashboard:
- gate-murano-dashboard-ubuntu
- gate-murano-dashboard-ubuntu-glare-nv
post:
- hook-murano-rtfd

View File

@ -37,23 +37,25 @@ def single_use_node(item, job, params):
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:
# NOTE(kzaitsev) Remove leading prefix (gate, heartbeat, etc.)
# and distro name together with everything that follows (note
# no '$' at the end). This should leave project's name
result = re.search("^\w+-(?P<proj_name>.*)-(?:ubuntu|debian)",
job.name)
if not result:
raise ValueError("Couldn't parse job name {}".format(
job.name))
project_name = result.group('proj_name')
if job.name != 'gate-murano-deployment':
# Get project name which can be different from ZUUL_PROJECT parameter
if 'murano-client' in job.name:
project_name = 'python-muranoclient'
else:
# NOTE(kzaitsev) Remove leading prefix (gate, heartbeat, etc.)
# and distro name together with everything that follows (note
# no '$' at the end). This should leave project's name
result = re.search("^\w+-(?P<proj_name>.*)-(?:ubuntu|debian)",
job.name)
if not result:
raise ValueError("Couldn't parse job name {}".format(
job.name))
project_name = result.group('proj_name')
# Set override_project parameter
params['OVERRIDE_PROJECT'] = "openstack/%s" % project_name
# 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':
deployment_ref = params['ZUUL_CHANGES'].rpartition(':')[2]
params['MURANO_DEPLOYMENT_REF'] = deployment_ref
params['ZUUL_REF'] = params.get('ZUUL_BRANCH', 'master')