blob: 328aa873d1413d515bdc568ed922908d8c4c941d [file] [log] [blame]
Mike Marchetti6930bc02017-05-31 16:33:02 -04001#!/bin/bash
2# Copyright 2017
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# 01 May 2017 -- Michael Marchetti -- adapted from template
17#
18
19HERE=$(realpath $(dirname $0))
20OSM_JENKINS=$(dirname $HERE)
21. $OSM_JENKINS/common/all_funcs
Mike Marchetti8343e3f2017-06-30 15:12:26 -040022. $OSM_JENKINS/common/install_common
Mike Marchetti6930bc02017-05-31 16:33:02 -040023
24INFO "Installing packages"
25apt-get update
garciadeblas7a2b4b72017-08-31 13:14:45 +020026apt-get install -y lxd
Mike Marchetti6930bc02017-05-31 16:33:02 -040027
28INFO "Configuring LXD"
29# ZFS doesn't work inside a nested container. ZFS should be configured in the host LXD.
30lxd init --auto
31lxd waitready
32systemctl stop lxd-bridge
33systemctl --system daemon-reload
34cat <<EOF > /etc/default/lxd-bridge
35USE_LXD_BRIDGE="true"
36LXD_BRIDGE="lxdbr0"
37UPDATE_PROFILE="true"
38LXD_CONFILE=""
39LXD_DOMAIN="lxd"
40LXD_IPV4_ADDR="10.44.126.1"
41LXD_IPV4_NETMASK="255.255.255.0"
42LXD_IPV4_NETWORK="10.44.126.1/24"
43LXD_IPV4_DHCP_RANGE="10.44.126.2,10.44.126.254"
44LXD_IPV4_DHCP_MAX="252"
45LXD_IPV4_NAT="true"
46LXD_IPV6_ADDR=""
47LXD_IPV6_MASK=""
48LXD_IPV6_NETWORK=""
49LXD_IPV6_NAT="false"
50LXD_IPV6_PROXY="false"
51EOF
52
53systemctl enable lxd-bridge
54systemctl start lxd-bridge
55
Mike Marchettif94dd8a2017-11-06 11:04:38 -050056apt-get install -y python-pip python python-pycurl charm-tools python-pytest python-openstackclient
Mike Marchetti6930bc02017-05-31 16:33:02 -040057
garciadeblas7a2b4b72017-08-31 13:14:45 +020058apt-get install -y python-osmclient
Mike Marchetti6930bc02017-05-31 16:33:02 -040059
Mike Marchetti425f8ce2017-06-15 13:02:16 -040060export OSM_USE_LOCAL_DEVOPS=true
garciadeblasa4385f72018-05-10 08:54:20 +020061echo "devops/installers/full_install_osm.sh --test --soui $*"
62devops/installers/full_install_osm.sh --test --soui $*
63#echo "devops/installers/full_install_osm.sh --test $*"
64#devops/installers/full_install_osm.sh --test $*
Mike Marchetti6930bc02017-05-31 16:33:02 -040065RC=$?
66
67# workaround. for upload packages, lxdbr0 needs to be promiscuous
68# as the upload calls back to the UI server so the lxdbr0 needs
69# to operate as a bridge
70ifconfig lxdbr0 promisc
71
72if [ $RC == 0 ]; then
73 # success. find all the resulting containers
74 . devops/installers/export_ips
75
76 TO_ADD="export OSM_HOSTNAME=$SO_CONTAINER_IP"
77 grep -q OSM_HOSTNAME ~/.bashrc && sed -i "s/.*OSM_HOSTNAME.*/$TO_ADD/" ~/.bashrc || echo -e "$TO_ADD\n$(cat ~/.bashrc)" > ~/.bashrc
Mike Marchetti8343e3f2017-06-30 15:12:26 -040078 TO_ADD="export OSM_RO_HOSTNAME=$RO_CONTAINER_IP"
79 grep -q OSM_RO_HOSTNAME ~/.bashrc && sed -i "s/.*OSM_RO_HOSTNAME.*/$TO_ADD/" ~/.bashrc || echo -e "$TO_ADD\n$(cat ~/.bashrc)" > ~/.bashrc
Mike Marchetti6930bc02017-05-31 16:33:02 -040080fi
81
82INFO "done, RC=$RC"
83exit $RC