diff options
author | 2016-09-25 01:49:57 +0200 | |
---|---|---|
committer | 2016-09-27 09:32:43 +0200 | |
commit | 17c580ad155f3256c86ceb078aee2cf8512a072e (patch) | |
tree | 62afda86462ded6aba4223905a504686a78955b7 /jjb/infra/bifrost-verify.sh | |
parent | 859efd8c2880674b9c9f280bd3fc39899d514446 (diff) |
bifrost: Refactor bifrost jobs
This change
- Creates job templates to verify opnfv/bifrost patches
- Introduces type in order to prepare verification on baremetal
- Fixes git cloning so the job shows changes for the corresponding project
- Gets rid of unnecessary slave parameters from slave-params.yml
- Fixes build blocking
- Updates the bifrost-verify.sh script and includes in shell so we don't have
to clone releng repo separately
- Updates destroy-env.sh to create /httpboot and /tftpboot with permissions 755
- Removes daily infra-bifrost job and scripts as we don't use them at the moment
Change-Id: Icb5a543628d3321bfe4e549ab92c67443ac578d8
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/infra/bifrost-verify.sh')
-rwxr-xr-x | jjb/infra/bifrost-verify.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/jjb/infra/bifrost-verify.sh b/jjb/infra/bifrost-verify.sh new file mode 100755 index 000000000..759b50b8e --- /dev/null +++ b/jjb/infra/bifrost-verify.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2016 Ericsson AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +set -o errexit +set -o nounset +set -o pipefail + +trap fix_ownership EXIT + +function fix_ownership() { + if [ -z "${JOB_URL+x}" ]; then + echo "Not running as part of Jenkins. Handle the logs manually." + else + sudo chown -R jenkins:jenkins $WORKSPACE + fi +} + +# check distro to see if we support it +if [[ ! "$DISTRO" =~ (trusty|centos7|suse) ]]; then + echo "Distro $DISTRO is not supported!" + exit 1 +fi + +# remove previously cloned repos +sudo /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng + +# clone all the repos first and checkout the patch afterwards +sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost +sudo git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud +sudo git clone https://gerrit.opnfv.org/gerrit/releng /opt/releng + +# checkout the patch +cd $CLONE_LOCATION +sudo git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD + +# combine opnfv and upstream scripts/playbooks +sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/ + +# cleanup remnants of previous deployment +cd /opt/bifrost +sudo -E ./scripts/destroy-env.sh + +# provision 3 VMs; jumphost, controller, and compute +cd /opt/bifrost +sudo -E ./scripts/test-bifrost-deployment.sh + +# list the provisioned VMs +cd /opt/bifrost +source env-vars +ironic node-list +virsh list |