2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 trap fix_ownership EXIT
16 function fix_ownership() {
17 if [ -z "${JOB_URL+x}" ]; then
18 echo "Not running as part of Jenkins. Handle the logs manually."
20 sudo chown -R jenkins:jenkins $WORKSPACE
21 sudo chown -R jenkins:jenkins ${HOME}/.cache
25 # check distro to see if we support it
26 if [[ ! "$DISTRO" =~ (trusty|centos7|suse) ]]; then
27 echo "Distro $DISTRO is not supported!"
31 # remove previously cloned repos
32 sudo /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng
37 # clone all the repos first and checkout the patch afterwards
38 sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
39 sudo git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud
40 sudo git clone https://gerrit.opnfv.org/gerrit/releng /opt/releng
44 sudo git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD
46 # combine opnfv and upstream scripts/playbooks
47 sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/
49 # cleanup remnants of previous deployment
51 sudo -E ./scripts/destroy-env.sh
53 # provision 3 VMs; jumphost, controller, and compute
55 sudo -E ./scripts/test-bifrost-deployment.sh
57 # list the provisioned VMs