blob: 12f06a18938256d51285a3f33e64f09160f0e3b7 [file] [log] [blame]
Jeremy Mordkoff6f07e6f2016-09-07 18:56:51 -04001#
2# Copyright 2016 RIFT.IO Inc
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# Author(s): Jeremy Mordkoff
17# Creation Date: 08/29/2016
18#
19#
20
21# BUILD.sh
22#
23# This is a top-level build script for RIFT.io
24#
25# args none
26#
27# dependencies -- requires sudo rights
28
29
30# ARGS
31
32PLATFORM_REPOSITORY=${1:-OSM}
33PLATFORM_VERSION=${2:-4.3.1.0.48360-1}
34
35# must be run from the top of a workspace
36cd $(dirname $0)
37
38
39
40
41# inside RIFT.io this is an NFS mount
42# so just to be safe
43test -h /usr/rift && sudo rm -f /usr/rift
44
45# get the container tools from the correct repository
46sudo rm -f /etc/yum.repos.d/private.repo
47sudo curl -o /etc/yum.repos.d/${PLATFORM_REPOSITORY}.repo \
48 http://buildtracker.riftio.com/repo_file/fc20/${PLATFORM_REPOSITORY}/
49sudo yum install --assumeyes rw.tools-container-tools rw.tools-scripts
50
51
52# enable the OSM repository hosted by RIFT.io
53# this contains the RIFT platform code and tools
54# and install of the packages required to build and run
55# this module
56sudo /usr/rift/container_tools/mkcontainer --modes build --modes ext --repo ${PLATFORM_REPOSITORY}
57
58temp=$(mktemp -d /tmp/rw.XXX)
59pushd $temp
60
61# yum does not accept the --nodeps and --replacefiles options so we
62# download first and then install
63yumdownloader rw.toolchain-rwbase-${PLATFORM_VERSION} \
64 rw.toolchain-rwtoolchain-${PLATFORM_VERSION} \
65 rw.core.mgmt-mgmt-${PLATFORM_VERSION} \
66 rw.core.util-util-${PLATFORM_VERSION} \
67 rw.core.rwvx-rwvx-${PLATFORM_VERSION} \
68 rw.core.rwvx-rwha-1.0-${PLATFORM_VERSION} \
69 rw.core.rwvx-rwdts-${PLATFORM_VERSION} \
70 rw.automation.core-RWAUTO-${PLATFORM_VERSION} \
71 rw.core.mc-models-1.0-${PLATFORM_VERSION}
72sudo rpm -i --replacefiles --nodeps *rpm
73popd
74rm -rf $temp
75
76# this file gets in the way of the one generated by the build
77sudo rm -f /usr/rift/usr/lib/libmano_yang_gen.so
78
79
80sudo chmod 777 /usr/rift /usr/rift/usr/share
81
82# install some base files used to create VNFs
83test -d /usr/rift/images || mkdir /usr/rift/images
84for file in Fedora-x86_64-20-20131211.1-sda-ping.qcow2 Fedora-x86_64-20-20131211.1-sda-pong.qcow2 Fedora-x86_64-20-20131211.1-sda.qcow2; do
85 test -f /usr/rift/images/$file || curl -o /usr/rift/images/$file http://repo.riftio.com/releases/open.riftio.com/4.3.1/$file
86done
87
88####### If you are re-building, you just need to run
89# these two steps
90make -j16
91sudo make install
92
93# note to start the RIFT.io UI please run
94echo 'sudo /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode --no-ui'