Skip to content

Commit

Permalink
not using s2i deployment dir (#23)
Browse files Browse the repository at this point in the history
as now we are mounting s2i deployment dir as a persistent volume
we dont need to back it up
  • Loading branch information
girishramnani authored and openshift-merge-robot committed Jul 26, 2019
1 parent c2062bb commit 697415e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
15 changes: 1 addition & 14 deletions assemble-and-restart
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,12 @@ else
/usr/libexec/s2i/assemble
fi

# After assemble script is run(which delets sources from destination dir by doing mv of them to the WorkingDir) and if only its component created from source,
# After assemble script is run(which deletes sources from destination dir by doing mv of them to the WorkingDir) and if only its component created from source,
# copy back the sources from Source backup dir to DestinationDir for subsequent push of only updates by watch
if [ ! -z "${ODO_S2I_WORKING_DIR}" ] && [ -n "$ODO_SRC_BACKUP_DIR" ] && ([ "${ODO_S2I_SRC_BIN_PATH}" != "${ODO_S2I_WORKING_DIR}" ] && [ "${ODO_S2I_DEPLOYMENT_DIR}" != "${ODO_S2I_WORKING_DIR}" ]); then
rsync -rlO ${ODO_SRC_BACKUP_DIR}/src/. ${ODO_S2I_SRC_BIN_PATH}/src/
fi

###
# Check "ODO_S2I_DEPLOYMENT_DIR" environment variable and if it's present,
# copy content of directory to ${ODO_DEPLOYMENT_BACKUP_DIR} directory
# Ref: https://github.com/openshift/odo/issues/445
if [ -n "$ODO_S2I_DEPLOYMENT_DIR" ]; then

if [ ! -d "${ODO_DEPLOYMENT_BACKUP_DIR}" ]; then
mkdir -p ${ODO_DEPLOYMENT_BACKUP_DIR}
fi

rsync -rlO ${ODO_S2I_DEPLOYMENT_DIR}/. ${ODO_DEPLOYMENT_BACKUP_DIR}/
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
Expand Down
8 changes: 0 additions & 8 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
set -x
set -eo pipefail

###
# Check "ODO_S2I_DEPLOYMENT_DIR" environment variable and if it's present,
# copy content from ${ODO_DEPLOYMENT_BACKUP_DIR} directory to "ODO_S2I_DEPLOYMENT_DIR"
# Ref: https://github.com/openshift/odo/issues/445
if [ -d ${ODO_DEPLOYMENT_BACKUP_DIR} ] && [ -n "$ODO_S2I_DEPLOYMENT_DIR" ]; then
rsync -rlO ${ODO_DEPLOYMENT_BACKUP_DIR}/. ${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.
Expand Down

0 comments on commit 697415e

Please sign in to comment.