Publish opnfvdocs pieman branch
[releng.git] / jjb / infra / openstack-bifrost-verify.sh
1 #!/bin/bash
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 ##############################################################################
10 set -o errexit
11 set -o nounset
12 set -o pipefail
13
14 trap fix_ownership EXIT
15
16 function fix_ownership() {
17     if [ -z "${JOB_URL+x}" ]; then
18         echo "Not running as part of Jenkins. Handle the logs manually."
19     else
20         chown -R jenkins:jenkins $WORKSPACE
21     fi
22 }
23
24 # check distro to see if we support it
25 # we will have centos and suse supported in future
26 case "$DISTRO" in
27     trusty)
28         #start the test
29         echo "Starting provisioning of 3 VMs"
30         ;;
31     *)
32         echo "Distro $DISTRO is not supported!"
33         exit 1
34 esac
35
36 # remove previously cloned repos
37 /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng
38
39 # clone upstream bifrost repo and checkout the patch to verify
40 git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
41 cd /opt/bifrost
42 git fetch https://git.openstack.org/openstack/bifrost $GERRIT_REFSPEC && git checkout FETCH_HEAD
43
44 # clone puppet-infracloud
45 git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud
46
47 # combine opnfv and upstream scripts/playbooks
48 cp -R $WORKSPACE/prototypes/bifrost/* /opt/bifrost/
49
50 # cleanup remnants of previous deployment
51 cd /opt/bifrost
52 ./scripts/destroy-env.sh
53
54 # provision 3 VMs; jumphost, controller, and compute
55 cd /opt/bifrost
56 ./scripts/test-bifrost-deployment.sh
57
58 # list the provisioned VMs
59 cd /opt/bifrost
60 source env-vars
61 ironic node-list
62 virsh list