Add http(s)_proxy handling to apex
[apex.git] / build / overcloud-onos.sh
1 #!/bin/sh
2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
4 #
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 -e
11 source ./cache.sh
12 source ./variables.sh
13
14 pushd ${BUILD_DIR} > /dev/null
15 cp -f overcloud-full.qcow2 overcloud-full-onos_build.qcow2
16
17 #######################################
18 #####    Adding ONOS to overcloud #####
19 #######################################
20
21 # get the onos files
22 rm -rf puppet-onos
23 populate_cache "$onos_release_uri/$onos_release_file" "$(curl https://downloads.onosproject.org/nightly/ | grep $onos_release_file | grep -o -e '[0-9a-f]\{32\}')"
24 populate_cache "$onos_jdk_uri/jdk-8u51-linux-x64.tar.gz"
25
26 LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE --upload ${CACHE_DIR}/${onos_release_file}:/opt/ \
27                                          --run-command "mkdir /opt/onos && cd /opt/ && tar -xzf $onos_release_file -C /opt/onos --strip-components=1" \
28                                          -a overcloud-full-onos_build.qcow2
29
30 #Those files can be store in local cache for saving download time
31 git clone https://github.com/bobzhouHW/puppet-onos.git
32 tar --xform="s:puppet-onos/:onos/:" -czf puppet-onos.tar.gz puppet-onos
33
34 LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE --upload ${CACHE_DIR}/jdk-8u51-linux-x64.tar.gz:/opt/ \
35                                          --upload ${BUILD_DIR}/puppet-onos/files/install_jdk8.tar:/opt/ \
36                                          --run-command "cd /opt/ && tar -xf install_jdk8.tar && sh /opt/install_jdk8/install_jdk8.sh" \
37                                          --upload ${BUILD_DIR}/puppet-onos/files/networking-onos.tar:/opt/ \
38                                          --run-command "cd /opt/ && tar -xf networking-onos.tar && sh /opt/networking-onos/install_driver.sh" \
39                                          --upload ${BUILD_DIR}/puppet-onos/files/networking-sfc.tar:/opt/ \
40                                          --run-command "cd /opt/ && tar -xf networking-sfc.tar && sh /opt/networking-sfc/install_driver.sh" \
41                                          --upload ${BUILD_DIR}/puppet-onos.tar.gz:/etc/puppet/modules/ \
42                                          --run-command "cd /etc/puppet/modules/ && tar xzf puppet-onos.tar.gz" \
43                                          -a overcloud-full-onos_build.qcow2
44
45 mv overcloud-full-onos_build.qcow2 overcloud-full-onos.qcow2
46 popd > /dev/null