From 697415e895d7cd5881421658cb9654c236f2653b Mon Sep 17 00:00:00 2001 From: Girish Ramnani Date: Sat, 27 Jul 2019 00:20:32 +0800 Subject: [PATCH] not using s2i deployment dir (#23) as now we are mounting s2i deployment dir as a persistent volume we dont need to back it up --- assemble-and-restart | 15 +-------------- run | 8 -------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/assemble-and-restart b/assemble-and-restart index de98a14..bdabac6 100755 --- a/assemble-and-restart +++ b/assemble-and-restart @@ -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 diff --git a/run b/run index a904c21..92504dc 100755 --- a/run +++ b/run @@ -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.