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 chown -R jenkins:jenkins $WORKSPACE
24 # check distro to see if we support it
25 # we will have centos and suse supported in future
29 echo "Starting provisioning of 3 VMs"
32 echo "Distro $DISTRO is not supported!"
36 # remove previously cloned repos
37 /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng
39 # clone upstream bifrost repo and checkout the patch to verify
40 git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
42 git fetch https://git.openstack.org/openstack/bifrost $GERRIT_REFSPEC && git checkout FETCH_HEAD
44 # clone puppet-infracloud
45 git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud
47 # combine opnfv and upstream scripts/playbooks
48 cp -R $WORKSPACE/prototypes/bifrost/* /opt/bifrost/
50 # cleanup remnants of previous deployment
52 ./scripts/destroy-env.sh
54 # provision 3 VMs; jumphost, controller, and compute
56 ./scripts/test-bifrost-deployment.sh
58 # list the provisioned VMs