Merge topics 'compute_count_fix', 'build_rewrite'
[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 images > /dev/null
15 cp -f overcloud-full.qcow2 overcloud-full-onos_build.qcow2
16
17 #######################################
18 #####    Adding ONOS to overcloud #####
19 #######################################
20
21 # upload the onos puppet module
22 rm -rf puppet-onos
23 git clone https://github.com/bobzhouHW/puppet-onos.git
24 pushd puppet-onos > /dev/null
25
26 # download jdk, onos and maven dependancy packages.
27 pushd files
28 for i in jdk-8u51-linux-x64.tar.gz onos-1.3.0.tar.gz repository.tar; do
29     populate_cache ${onos_artifacts_uri}/$i
30     get_cached_file $i
31 done
32 popd > /dev/null
33
34 popd > /dev/null
35 tar --xform="s:puppet-onos/:onos/:" -czf puppet-onos.tar.gz puppet-onos
36
37 LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-onos.tar.gz:/etc/puppet/modules/ \
38                                          --run-command "cd /etc/puppet/modules/ && tar xzf puppet-onos.tar.gz" -a overcloud-full-onos_build.qcow2
39 mv overcloud-full-onos_build.qcow2 overcloud-full-onos.qcow2
40 popd > /dev/null