Skip to content

Commit

Permalink
Resolves wildfly issue
Browse files Browse the repository at this point in the history
  • Loading branch information
surajnarwade committed Nov 21, 2018
1 parent 00f6f6f commit ee6d799
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions assemble-and-restart
Expand Up @@ -2,6 +2,7 @@
set -x
set -eo pipefail


# We now run the assembly script. If there is a custom one written in the
# source files, we use that instead.
if [ -f ${ODO_S2I_SRC_BIN_PATH}/.s2i/bin/assemble ]; then
Expand All @@ -13,6 +14,23 @@ else
/usr/libexec/s2i/assemble
fi

###
# Check "ODO_S2I_DEPLOYMENT_DIR" environment variable and if it's present,
# copy content of directory to /opt/app-root/backup directory
# Ref: https://github.com/redhat-developer/odo/issues/445

if [ ! -d /opt/app-root/backup ]; then
mkdir /opt/app-root/backup
fi

if [ -z "$ODO_S2I_DEPLOYMENT_DIR" ]
then
echo "\$ODO_S2I_DEPLOYMENT_DIR is empty"
else
cp -rvf ${ODO_S2I_DEPLOYMENT_DIR}/* /opt/app-root/backup/
fi
####

# Restart supervisord in order to actualy run the application
# This is a dumb way to start as supervisord does not have a restart function
/var/lib/supervisord/bin/supervisord ctl stop run; /var/lib/supervisord/bin/supervisord ctl start run
12 changes: 12 additions & 0 deletions run
Expand Up @@ -2,6 +2,18 @@
set -x
set -eo pipefail

###
# Check "ODO_S2I_DEPLOYMENT_DIR" environment variable and if it's present,
# copy content from /opt/app-root/backup directory to "ODO_S2I_DEPLOYMENT_DIR"
# Ref: https://github.com/redhat-developer/odo/issues/445
if [ -z "$ODO_S2I_DEPLOYMENT_DIR" ]
then
echo "\$ODO_S2I_DEPLOYMENT_DIR is empty"
else
cp -rvf /opt/app-root/backup/* ${ODO_S2I_DEPLOYMENT_DIR}/
fi
###

# We now run the run script. If there is a custom one written in the
# source files, we use that instead.
if [ -f ${ODO_S2I_SRC_BIN_PATH}/.s2i/bin/run ]; then
Expand Down

0 comments on commit ee6d799

Please sign in to comment.