aboutsummaryrefslogtreecommitdiffstats
path: root/packages/docker/src
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2017-03-08 10:03:14 -0500
committerAlexis de Talhouët <adetalhouet89@gmail.com>2017-03-08 10:03:14 -0500
commitc4a12db99ca3789cf9e0e3475bba8f12e9b29e0b (patch)
tree8fb562fe945507359158b4626b65159a3061d45d /packages/docker/src
parent9c83a7fc42c615140a61a339c2647b2e8eac9956 (diff)
Do not start chef-solo if mso-docker.json is empty
Chef-solo is started both from the docker container [1] and from the start-jboss-server.sh script [2]. The Dockerfile is configured to erase the mso-docker.json configuration once applied, so when the container is started, and the strat-jboss-server.sh tries to play the recipes again, it fails as the environment file is empty. This patch adds a check to see if the file is empty, if not, we play the chef-solo recipes again, to overwrite the config. [1]: https://gerrit.openecomp.org/r/gitweb?p=mso.git;a=blob;f=packages/docker/src/main/docker/docker-files/Dockerfile.mso-chef-final;h=ff7f44bcfdba6fa0328cbd50803d3dc80a2a1def;hb=refs/heads/master#l57 [2]: https://gerrit.openecomp.org/r/gitweb?p=mso.git;a=blob;f=packages/docker/src/main/docker/docker-files/scripts/start-jboss-server.sh;h=2e9b9da27dd3d01fcf5ebc304ac03b15142fde53;hb=refs/heads/master#l16 Change-Id: I34573dedaaafbeb6b511f47b72e6e0cefea4e1d5 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'packages/docker/src')
-rwxr-xr-x[-rw-r--r--]packages/docker/src/main/docker/docker-files/scripts/start-jboss-server.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/docker/src/main/docker/docker-files/scripts/start-jboss-server.sh b/packages/docker/src/main/docker/docker-files/scripts/start-jboss-server.sh
index 2e9b9da27d..d8d81cca6c 100644..100755
--- a/packages/docker/src/main/docker/docker-files/scripts/start-jboss-server.sh
+++ b/packages/docker/src/main/docker/docker-files/scripts/start-jboss-server.sh
@@ -12,9 +12,14 @@ update-ca-certificates
echo 'Running in JBOSS'
su - jboss
-#Start the chef-solo
-chef-solo -c /var/berks-cookbooks/${CHEF_REPO_NAME}/solo.rb -o recipe[mso-config::apih],recipe[mso-config::bpmn],recipe[mso-config::jra]
-
+#Start the chef-solo if mso-docker.json contains some data.
+if [ -s /var/berks-cookbooks/${CHEF_REPO_NAME}/environments/mso-docker.json ]
+then
+ echo "mso-docker.json has some configuration, replay the recipes."
+ chef-solo -c /var/berks-cookbooks/${CHEF_REPO_NAME}/solo.rb -o recipe[mso-config::apih],recipe[mso-config::bpmn],recipe[mso-config::jra]
+else
+ echo "mso-docker.json is empty, do not replay the recipes."
+fi
JBOSS_PIDFILE=/tmp/jboss-standalone.pid
$JBOSS_HOME/bin/standalone.sh -c standalone-full-ha-mso.xml &