| garciadeblas | a1fc457 | 2017-04-24 19:08:21 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # Authors: |
| 18 | # - Gerardo Garcia - gerardo.garciadeblas@telefonica.com |
| 19 | # |
| 20 | |
| 21 | HERE=$(realpath $(dirname $0)) |
| 22 | OSM_JENKINS=$(dirname $HERE) |
| 23 | . $OSM_JENKINS/common/all_funcs |
| 24 | |
| 25 | # SET YOUR MDG repository name here |
| 26 | export OSM_MDG=RO |
| 27 | OSM_load_config |
| 28 | |
| 29 | # Installation starts here |
| garciadeblas | a1fc457 | 2017-04-24 19:08:21 +0200 | [diff] [blame] | 30 | |
| 31 | #Release TWO |
| garciadeblas | 765e136 | 2017-04-26 23:52:41 +0200 | [diff] [blame] | 32 | curl https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO/OSM%20ETSI%20Release%20Key.gpg |apt-key add - |
| garciadeblas | 620c90b | 2017-04-27 12:39:07 +0200 | [diff] [blame] | 33 | sleep 5 |
| garciadeblas | 765e136 | 2017-04-26 23:52:41 +0200 | [diff] [blame] | 34 | add-apt-repository -y "deb https://osm-download.etsi.org/repository/osm/debian/ReleaseTWO stable RO openvim" |
| garciadeblas | a1fc457 | 2017-04-24 19:08:21 +0200 | [diff] [blame] | 35 | |
| 36 | apt-get update |
| 37 | apt-get -y install python-lib-osm-openvim |
| 38 | apt-get -y install python-osm-ro |
| 39 | |
| garciadeblas | 5307402 | 2017-04-27 12:14:11 +0200 | [diff] [blame] | 40 | OSMLIBOVIM_PATH=`python -c 'import lib_osm_openvim; print lib_osm_openvim.__path__[0]'` || FATAL "lib-osm-openvim was not properly installed" |
| garciadeblas | a1fc457 | 2017-04-24 19:08:21 +0200 | [diff] [blame] | 41 | OSMRO_PATH=`python -c 'import osm_ro; print osm_ro.__path__[0]'` || FATAL "osm-ro was not properly installed" |
| garciadeblas | 5307402 | 2017-04-27 12:14:11 +0200 | [diff] [blame] | 42 | sed -i "s/\${DIRNAME}\/\.\.\/openmanod\ -v/openmanod\ -v/g" /usr/lib/python2.7/dist-packages/osm_ro/database_utils/migrate_mano_db.sh |
| 43 | systemctl disable osm-ro.service |
| 44 | sed -i "/User=/d" /etc/systemd/system/osm-ro.service |
| 45 | sed -i "s/ExecStart=openmanod/ExecStart=\/usr\/bin\/openmanod/" /etc/systemd/system/osm-ro.service |
| 46 | systemctl enable osm-ro.service |
| garciadeblas | a1fc457 | 2017-04-24 19:08:21 +0200 | [diff] [blame] | 47 | |
| garciadeblas | 5307402 | 2017-04-27 12:14:11 +0200 | [diff] [blame] | 48 | DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server |
| 49 | |
| 50 | ${OSMRO_PATH}/database_utils/install-db-server.sh --updatedb --no-install-packages || FATAL "osm-ro db installation failed" |
| garciadeblas | a1fc457 | 2017-04-24 19:08:21 +0200 | [diff] [blame] | 51 | ${OSMLIBOVIM_PATH}/database_utils/install-db-server.sh -u mano -p manopw -d mano_vim_db --updatedb || FATAL "lib-osm-openvim db installation failed" |
| 52 | service osm-ro restart |
| 53 | |
| 54 | RC=$? |
| 55 | INFO "done, RC=$RC" |
| 56 | exit $RC |
| 57 | |
| 58 | |