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

View File

@ -23,8 +23,16 @@ STACK_HOME='/opt/stack'
ZUUL_URL=${ZUUL_URL:-'https://git.openstack.org'} ZUUL_URL=${ZUUL_URL:-'https://git.openstack.org'}
ZUUL_REF=${ZUUL_REF:-'master'} 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'} 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 if [[ -n "${OVERRIDE_BRANCH}" ]]; then
ZUUL_BRANCH=$OVERRIDE_BRANCH ZUUL_BRANCH=$OVERRIDE_BRANCH
ZUUL_REF=$OVERRIDE_BRANCH ZUUL_REF=$OVERRIDE_BRANCH
@ -34,10 +42,6 @@ if [[ -n "${OVERRIDE_URL}" ]]; then
ZUUL_URL=$OVERRIDE_URL ZUUL_URL=$OVERRIDE_URL
fi fi
if [[ -n "${OVERRIDE_PROJECT}" ]]; then
ZUUL_PROJECT=$OVERRIDE_PROJECT
fi
EXECUTE_TESTS_BY_TAG=${EXECUTE_TESTS_BY_TAG:-''} EXECUTE_TESTS_BY_TAG=${EXECUTE_TESTS_BY_TAG:-''}
APPS_REPO=${APPS_REPO:-https://github.com/openstack/murano-apps} 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_REPO=${MURANO_PYTHONCLIENT_REPO:-git://git.openstack.org/openstack/python-muranoclient.git}
MURANO_PYTHONCLIENT_BRANCH=${ZUUL_BRANCH} MURANO_PYTHONCLIENT_BRANCH=${ZUUL_BRANCH}
PROJECT_NAME=${ZUUL_PROJECT##*/}
APT_PROXY_HOST=${APT_PROXY_HOST:-''} APT_PROXY_HOST=${APT_PROXY_HOST:-''}
OPENSTACK_HOST=${OPENSTACK_HOST:-$KEYSTONE_URL} OPENSTACK_HOST=${OPENSTACK_HOST:-$KEYSTONE_URL}
@ -122,7 +124,7 @@ case "${PROJECT_NAME}" in
echo "No tests currently available" 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 exit 1
;; ;;
esac esac

View File

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

View File

@ -19,6 +19,19 @@ pipelines:
verified: -1 verified: -1
failure-message: To re-run the job please post a comment with `retrigger murano-ci` 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 - name: post
description: This pipeline runs jobs that operate after each change is merged. description: This pipeline runs jobs that operate after each change is merged.
manager: IndependentPipelineManager manager: IndependentPipelineManager
@ -33,6 +46,9 @@ projects:
check: check:
- gate-murano-ubuntu - gate-murano-ubuntu
- gate-murano-ubuntu-glare-nv - gate-murano-ubuntu-glare-nv
check_dashboard:
- gate-murano-dashboard-ubuntu
- gate-murano-dashboard-ubuntu-glare-nv
post: post:
- hook-murano-rtfd - hook-murano-rtfd

View File

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