blob: 12f06a18938256d51285a3f33e64f09160f0e3b7 [file] [log] [blame]
#
# Copyright 2016 RIFT.IO Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author(s): Jeremy Mordkoff
# Creation Date: 08/29/2016
#
#
# BUILD.sh
#
# This is a top-level build script for RIFT.io
#
# args none
#
# dependencies -- requires sudo rights
# ARGS
PLATFORM_REPOSITORY=${1:-OSM}
PLATFORM_VERSION=${2:-4.3.1.0.48360-1}
# must be run from the top of a workspace
cd $(dirname $0)
# inside RIFT.io this is an NFS mount
# so just to be safe
test -h /usr/rift && sudo rm -f /usr/rift
# get the container tools from the correct repository
sudo rm -f /etc/yum.repos.d/private.repo
sudo curl -o /etc/yum.repos.d/${PLATFORM_REPOSITORY}.repo \
http://buildtracker.riftio.com/repo_file/fc20/${PLATFORM_REPOSITORY}/
sudo yum install --assumeyes rw.tools-container-tools rw.tools-scripts
# enable the OSM repository hosted by RIFT.io
# this contains the RIFT platform code and tools
# and install of the packages required to build and run
# this module
sudo /usr/rift/container_tools/mkcontainer --modes build --modes ext --repo ${PLATFORM_REPOSITORY}
temp=$(mktemp -d /tmp/rw.XXX)
pushd $temp
# yum does not accept the --nodeps and --replacefiles options so we
# download first and then install
yumdownloader rw.toolchain-rwbase-${PLATFORM_VERSION} \
rw.toolchain-rwtoolchain-${PLATFORM_VERSION} \
rw.core.mgmt-mgmt-${PLATFORM_VERSION} \
rw.core.util-util-${PLATFORM_VERSION} \
rw.core.rwvx-rwvx-${PLATFORM_VERSION} \
rw.core.rwvx-rwha-1.0-${PLATFORM_VERSION} \
rw.core.rwvx-rwdts-${PLATFORM_VERSION} \
rw.automation.core-RWAUTO-${PLATFORM_VERSION} \
rw.core.mc-models-1.0-${PLATFORM_VERSION}
sudo rpm -i --replacefiles --nodeps *rpm
popd
rm -rf $temp
# this file gets in the way of the one generated by the build
sudo rm -f /usr/rift/usr/lib/libmano_yang_gen.so
sudo chmod 777 /usr/rift /usr/rift/usr/share
# install some base files used to create VNFs
test -d /usr/rift/images || mkdir /usr/rift/images
for 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
test -f /usr/rift/images/$file || curl -o /usr/rift/images/$file http://repo.riftio.com/releases/open.riftio.com/4.3.1/$file
done
####### If you are re-building, you just need to run
# these two steps
make -j16
sudo make install
# note to start the RIFT.io UI please run
echo 'sudo /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode --no-ui'