summaryrefslogtreecommitdiffstats
path: root/build/overcloud-onos.sh
blob: 88f0b1664a75046ba3102c75fbb0f379369022c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
##############################################################################
# Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
set -e
source ./cache.sh
source ./variables.sh

pushd images > /dev/null
cp -f overcloud-full.qcow2 overcloud-full-onos_build.qcow2

#######################################
#####    Adding ONOS to overcloud #####
#######################################

# upload the onos puppet module
rm -rf puppet-onos
git clone https://github.com/bobzhouHW/puppet-onos.git
pushd puppet-onos > /dev/null

# download jdk, onos and maven dependancy packages.
pushd files
for i in jdk-8u51-linux-x64.tar.gz onos-1.3.0.tar.gz repository.tar; do
    populate_cache ${onos_artifacts_uri}/$i
    get_cached_file $i
done
popd > /dev/null

popd > /dev/null
tar --xform="s:puppet-onos/:onos/:" -czf puppet-onos.tar.gz puppet-onos

LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-onos.tar.gz:/etc/puppet/modules/ \
                                         --run-command "cd /etc/puppet/modules/ && tar xzf puppet-onos.tar.gz" -a overcloud-full-onos_build.qcow2
mv overcloud-full-onos_build.qcow2 overcloud-full-onos.qcow2
popd > /dev/null