Install from binaries, including renaming of installer, host install and install scripts for RO, SO and UI

Change-Id: Id6e9a134df1fb55969183d2cdf0efd49b1d34e10
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/jenkins/RO/install b/jenkins/RO/install
new file mode 100755
index 0000000..2f6be01
--- /dev/null
+++ b/jenkins/RO/install
@@ -0,0 +1,69 @@
+#!/bin/bash
+#
+#   Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
+#
+#   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.
+# 
+# Authors:
+#    - Gerardo Garcia - gerardo.garciadeblas@telefonica.com
+# 
+
+HERE=$(realpath $(dirname $0))
+OSM_JENKINS=$(dirname $HERE)
+. $OSM_JENKINS/common/all_funcs
+
+# SET YOUR MDG repository name here
+export OSM_MDG=RO
+OSM_load_config
+
+# Installation starts here
+apt-get update
+
+apt-get -y install python-pip
+pip install --upgrade pip
+pip install pyvcloud
+pip install progressbar
+pip install prettytable
+pip install pyvmomi
+
+#Dependencies below will be installed directly from packages and must be removed
+#apt-get -y install libmysqlclient-dev libssl-dev libffi-dev mysql-client
+#apt-get -y install python-yaml python-bottle python-mysqldb python-jsonschema python-paramiko python-argcomplete python-requests python-logutils
+#apt-get -y install python-cinderclient python-glanceclient python-keystoneclient python-neutronclient python-novaclient python-mysqldb python-yaml
+#apt-get -y install python-boto
+
+#Release ONE
+curl https://osm-download.etsi.org/repository/osm/debian/ReleaseONE/OSM%20ETSI%20Release%20Key.gpg |apt-key add -
+add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseONE unstable RO openvim"
+#add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseONE stable RO openvim"
+
+#Release TWO
+#curl https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO/OSM%20ETSI%20Release%20Key.gpg |apt-key add -
+#add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO stable RO openvim"
+
+apt-get update
+apt-get -y install python-lib-osm-openvim
+apt-get -y install python-osm-ro
+
+OSMLIBOVIM_PATH=`python -c 'import lib_osm_openvim; print lib_osm_openvim.__path__[0]'` || FATAL "lib-osm-openvim was not properly installed" 
+OSMRO_PATH=`python -c 'import osm_ro; print osm_ro.__path__[0]'` || FATAL "osm-ro was not properly installed"
+
+${OSMRO_PATH}/database_utils/install-db-server.sh --updatedb || FATAL "osm-ro db installation failed"
+${OSMLIBOVIM_PATH}/database_utils/install-db-server.sh -u mano -p manopw -d mano_vim_db --updatedb || FATAL "lib-osm-openvim db installation failed"
+service osm-ro restart
+
+RC=$?
+INFO "done, RC=$RC"
+exit $RC
+
+
diff --git a/jenkins/SO/install b/jenkins/SO/install
new file mode 100755
index 0000000..b45b4cb
--- /dev/null
+++ b/jenkins/SO/install
@@ -0,0 +1,87 @@
+#!/bin/bash
+#   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.
+# 
+# TEMPLATE script to start a build. This is run inside a container
+#
+# 6 July 2016 -- Jeremy.Mordkoff@riftio.com -- adapted from the riftware version
+# 
+
+HERE=$(realpath $(dirname $0))
+OSM_JENKINS=$(dirname $HERE)
+. $OSM_JENKINS/common/all_funcs
+
+# SET YOU MDG repository name here
+export OSM_MDG=SO
+OSM_load_config
+
+#OSM_git_checkout "$@"
+
+#trap 'WARNING "INTERRUPT"; exit 1' INT
+
+#./BUILD.sh -s
+
+INFO "starting install $MDG"
+
+#curl http://repos.riftio.com/public/xenial-riftware-public-key | sudo apt-key add -
+#curl -o /etc/apt/sources.list.d/RIFT.list http://buildtracker.riftio.com/repo_file/ub16/OSM/
+#apt-get update
+#apt-get install -y libxml2-dev libxslt-dev
+#/usr/rift/container_tools/mkcontainer --modes build --modes ext --repo OSM
+#pip3 install lxml==3.4.0
+
+#Release ONE
+curl https://osm-download.etsi.org/repository/osm/debian/ReleaseONE/OSM%20ETSI%20Release%20Key.gpg |apt-key add -
+add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseONE unstable SO UI RO openvim"
+#add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseONE stable SO UI RO openvim"
+
+#Release TWO
+#curl https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO/OSM%20ETSI%20Release%20Key.gpg |apt-key add -
+#add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO stable SO UI RO openvim"
+
+apt-get update
+apt-get install -y \
+    rw.core.mano-rwcal_yang_ylib-1.0 \
+    rw.core.mano-rwconfig_agent_yang_ylib-1.0 \
+    rw.core.mano-rwlaunchpad_yang_ylib-1.0 \
+    rw.core.mano-mano_yang_ylib-1.0 \
+    rw.core.mano-common-1.0 \
+    rw.core.mano-rwsdn_yang_ylib-1.0 \
+    rw.core.mano-rwsdnal_yang_ylib-1.0 \
+    rw.core.mano-rwsdn-1.0 \
+    rw.core.mano-mano-types_yang_ylib-1.0 \
+    rw.core.mano-rwcal-cloudsim-1.0 \
+    rw.core.mano-rwcal-1.0 \
+    rw.core.mano-rw_conman_yang_ylib-1.0 \
+    rw.core.mano-rwcalproxytasklet-1.0 \
+    rw.core.mano-rwlaunchpad-1.0 \
+    rw.core.mano-rwcal-openmano-vimconnector-1.0 \
+    rw.core.mano-rwcal-propcloud1-1.0 \
+    rw.core.mano-lpmocklet_yang_ylib-1.0 \
+    rw.core.mano-rwmon-1.0 \
+    rw.core.mano-rwcloud_yang_ylib-1.0 \
+    rw.core.mano-rwcal-openstack-1.0 \
+    rw.core.mano-rw.core.mano_foss \
+    rw.core.mano-rwmon_yang_ylib-1.0 \
+    rw.core.mano-rwcm-1.0 \
+    rw.core.mano-rwcal-mock-1.0 \
+    rw.core.mano-rwcal-cloudsimproxy-1.0 \
+    rw.core.mano-models-1.0 \
+    rw.core.mano-rwcal-aws-1.0
+
+RC=$?
+
+INFO "done, RC=$RC"
+exit $RC
+
diff --git a/jenkins/UI/install b/jenkins/UI/install
new file mode 100755
index 0000000..2a3b9b6
--- /dev/null
+++ b/jenkins/UI/install
@@ -0,0 +1,62 @@
+#!/bin/bash
+#   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.
+# 
+# TEMPLATE script to start a build. This is run inside a container
+#
+# 6 July 2016 -- Jeremy.Mordkoff@riftio.com -- adapted from the riftware version
+# 
+
+HERE=$(realpath $(dirname $0))
+OSM_JENKINS=$(dirname $HERE)
+. $OSM_JENKINS/common/all_funcs
+
+# SET YOU MDG repository name here
+export OSM_MDG=UI
+OSM_load_config
+
+#OSM_git_checkout "$@"
+
+#trap 'WARNING "INTERRUPT"; exit 1' INT
+
+#./BUILD.sh -u
+
+INFO "starting install $MDG"
+
+#Release ONE
+curl https://osm-download.etsi.org/repository/osm/debian/ReleaseONE/OSM%20ETSI%20Release%20Key.gpg |apt-key add -
+add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseONE unstable SO UI RO openvim"
+#add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseONE stable SO UI RO openvim"
+
+#Release TWO
+#curl https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO/OSM%20ETSI%20Release%20Key.gpg |apt-key add -
+#add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO stable SO UI RO openvim"
+
+apt-get update
+apt-get install -y \
+    rw.ui-about \
+    rw.ui-logging \
+    rw.ui-skyquake \
+    rw.ui-accounts \
+    rw.ui-composer \
+    rw.ui-launchpad \
+    rw.ui-debug \
+    rw.ui-config \
+    rw.ui-dummy_component
+
+RC=$?
+
+INFO "done, RC=$RC"
+exit $RC
+
diff --git a/jenkins/host/install b/jenkins/host/install
new file mode 100755
index 0000000..ade30fb
--- /dev/null
+++ b/jenkins/host/install
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+#   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.
+#
+# install is run on a host to install a MDG from binaries
+#
+
+
+HERE=$(realpath $(dirname $0))
+OSM_JENKINS=$(dirname $HERE)
+. $OSM_JENKINS/common/all_funcs
+
+[ $# -lt 1 ] && FATAL "arg is MDG name"
+
+export OSM_MDG=$1
+shift
+OSM_load_config
+
+if ! container_exists $OSM_BUILD_CONTAINER; then
+	CONTAINER_OPTS=""
+	[[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true"
+	[[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true"
+	create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS
+	wait_container_up $OSM_BUILD_CONTAINER
+	if [ ${OSM_USE_LOCAL_DEVOPS:-false} ]; then
+		container_push_devops $OSM_BUILD_CONTAINER
+	else
+		container_exec $OSM_BUILD_CONTAINER git clone ${OSM_GIT_URL}/devops
+	fi
+else
+	if [ ${OSM_USE_LOCAL_DEVOPS:-false} ]; then
+		container_push_devops $OSM_BUILD_CONTAINER
+	else
+		container_exec $OSM_BUILD_CONTAINER git -C devops pull
+	fi
+fi
+
+container_exec $OSM_BUILD_CONTAINER ./devops/jenkins/$OSM_MDG/install $*
+RC=$?
+INFO "$OSM_MDG install complete. Return code was $RC"
+exit $RC
+