From af0017fe88d4675473428f51041d7b124abe299a Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 12 Sep 2018 16:25:42 +0200 Subject: [PATCH] Adding RO-start.sh to deb package for Dockerfile Change-Id: I2f61868a288a8217dbf2a5c0920f736ec547ffcc Signed-off-by: tierno --- docker/Dockerfile-fromdeb | 4 +--- docker/Dockerfile-local | 4 +--- docker/scripts/start.sh => scripts/RO-start.sh | 4 ++++ setup.py | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) rename docker/scripts/start.sh => scripts/RO-start.sh (95%) diff --git a/docker/Dockerfile-fromdeb b/docker/Dockerfile-fromdeb index de01e39b..73adb2b9 100644 --- a/docker/Dockerfile-fromdeb +++ b/docker/Dockerfile-fromdeb @@ -26,8 +26,6 @@ RUN apt-get update && apt-get install -y curl mysql-client software-properties-c && mkdir -p /bin/RO -COPY docker/scripts/ /bin/RO - VOLUME /opt/openmano/logs EXPOSE 9090 @@ -54,5 +52,5 @@ ENV RO_DB_NAME=mano_db ENV RO_DB_OVIM_NAME=mano_vim_db -CMD /bin/RO/start.sh +CMD RO-start.sh diff --git a/docker/Dockerfile-local b/docker/Dockerfile-local index aad357c3..c073a12c 100644 --- a/docker/Dockerfile-local +++ b/docker/Dockerfile-local @@ -4,8 +4,6 @@ LABEL authors="Gennadiy Dubina, Alfonso Tierno, Gerardo Garcia" COPY . /root/RO -COPY docker/scripts/ /bin/RO - RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \ DEBIAN_FRONTEND=noninteractive add-apt-repository -y cloud-archive:queens && \ @@ -72,5 +70,5 @@ ENV RO_DB_HOST="" \ RO_DB_OVIM_NAME=mano_vim_db \ OPENMANO_TENANT=osm -CMD /bin/RO/start.sh +CMD /root/RO/scripts/RO-start.sh diff --git a/docker/scripts/start.sh b/scripts/RO-start.sh similarity index 95% rename from docker/scripts/start.sh rename to scripts/RO-start.sh index 1506e3a3..afc746a6 100755 --- a/docker/scripts/start.sh +++ b/scripts/RO-start.sh @@ -1,5 +1,9 @@ #!/bin/bash +# This script is intended for launching RO from a docker container. +# It waits for mysql server ready, normally running on a separate container, ... +# then it checks if database is present and creates it if needed. +# Finally it launches RO server. [ -z "$RO_DB_OVIM_HOST" ] && export RO_DB_OVIM_HOST="$RO_DB_HOST" [ -z "$RO_DB_OVIM_ROOT_PASSWORD" ] && export RO_DB_OVIM_ROOT_PASSWORD="$RO_DB_ROOT_PASSWORD" diff --git a/setup.py b/setup.py index 97d7b4b7..05431bd4 100755 --- a/setup.py +++ b/setup.py @@ -60,7 +60,8 @@ setup(name=_name, data_files = [('/etc/osm/', ['osm_ro/openmanod.cfg']), ('/etc/systemd/system/', ['osm_ro/osm-ro.service']), ], - scripts=['openmanod', 'openmano', 'osm_ro/scripts/service-openmano', 'osm_ro/scripts/openmano-report',], + scripts=['openmanod', 'openmano', 'osm_ro/scripts/service-openmano', 'osm_ro/scripts/openmano-report', + 'osm_ro/scripts/RO-start.sh'], install_requires=_requirements, include_package_data=True, setup_requires=['setuptools-version-command'], -- 2.25.1