summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef
diff options
context:
space:
mode:
authorDmitry Puzikov <d.puzikov2@partner.samsung.com>2020-03-05 18:03:15 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-03-06 15:49:05 +0000
commit0574f88247e18e830663802c2167df3166e1792b (patch)
treef806d457894b57810fa6cc7b487511be42b99a94 /sdc-os-chef
parenta6b1e08a4f0c577746a688c1533259f2ab235f2f (diff)
Fix docker_run.sh script
Add check of plugins-configuration.yaml file. If file doesn't exist don't mount volume to container. Added changes proposed in ticket discussion. Change-Id: I7025330afd9eb4e701ffc7dccaf0932ae72d8e11 Issue-ID: SDC-2759 Signed-off-by: Dmitry Puzikov <d.puzikov2@partner.samsung.com>
Diffstat (limited to 'sdc-os-chef')
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh34
1 files changed, 31 insertions, 3 deletions
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index 759c4699d5..7d24c98c10 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -364,15 +364,43 @@ function sdc-onboard-BE {
# Front-End
function sdc-FE {
DOCKER_NAME="sdc-FE"
- echo "docker run sdc-frontend..."
+ IMAGE_NAME="${PREFIX}/sdc-frontend:${RELEASE}"
+ echo "Running container '${DOCKER_NAME}' based on '${IMAGE_NAME}' image..."
if [ ${LOCAL} = false ]; then
docker pull ${PREFIX}/sdc-frontend:${RELEASE}
else
ADDITIONAL_ARGUMENTS=${FE_DEBUG_PORT}
fi
- docker run --detach --name ${DOCKER_NAME} --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${FE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 ${LOCAL_TIME_MOUNT_CMD} --volume ${WORKSPACE}/data/logs/FE/:${JETTY_BASE}/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --volume ${WORKSPACE}/data/environments/plugins-configuration.yaml:${JETTY_BASE}/config/catalog-fe/plugins-configuration.yaml --publish 9443:9443 --publish 8181:8181 ${ADDITIONAL_ARGUMENTS} ${PREFIX}/sdc-frontend:${RELEASE}
+
+ PLUGIN_CONFIG_FILE="${WORKSPACE}/data/environments/plugins-configuration.yaml"
+ if [[ -f ${WORKSPACE}/data/environments/plugins-configuration.yaml ]]; then
+ PLUGINS_CONF_VOLUME_MOUNT="--volume ${PLUGIN_CONFIG_FILE}:${JETTY_BASE}/config/catalog-fe/plugins-configuration.yaml"
+ else
+ echo "INFO: '${PLUGIN_CONFIG_FILE}' not provided, ignoring..."
+ fi
+
+ docker run \
+ --detach \
+ --name ${DOCKER_NAME} \
+ --env HOST_IP=${IP} \
+ --env ENVNAME="${DEP_ENV}" \
+ --env JAVA_OPTIONS="${FE_JAVA_OPTIONS}" \
+ --log-driver=json-file \
+ --log-opt max-size=100m \
+ --log-opt max-file=10 \
+ --ulimit memlock=-1:-1 \
+ --ulimit nofile=4096:100000 \
+ --volume ${WORKSPACE}/data/logs/FE/:${JETTY_BASE}/logs \
+ --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments \
+ ${LOCAL_TIME_MOUNT_CMD} \
+ ${PLUGINS_CONF_VOLUME_MOUNT} \
+ --publish 9443:9443 \
+ --publish 8181:8181 \
+ ${ADDITIONAL_ARGUMENTS} \
+ ${IMAGE_NAME}
+
command_exit_status $? ${DOCKER_NAME}
- echo "please wait while FE is starting....."
+ echo "Please wait while '${DOCKER_NAME}' container is starting..."
monitor_docker ${DOCKER_NAME}
}
#