Skip to content
Snippets Groups Projects
install 2.2 KiB
Newer Older
#!/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

#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"
sed -i "s/\${DIRNAME}\/\.\.\/openmanod\ -v/openmanod\ -v/g" /usr/lib/python2.7/dist-packages/osm_ro/database_utils/migrate_mano_db.sh
systemctl disable osm-ro.service
sed -i "/User=/d" /etc/systemd/system/osm-ro.service
sed -i "s/ExecStart=openmanod/ExecStart=\/usr\/bin\/openmanod/" /etc/systemd/system/osm-ro.service
systemctl enable osm-ro.service

DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server
${OSMRO_PATH}/database_utils/install-db-server.sh --updatedb --no-install-packages || 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