Skip to content

Commit

Permalink
Rsync instead of mv, and don't move app-manager to /workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleykleynhans committed Jul 2, 2024
1 parent 31aa584 commit df5cddf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions scripts/pre_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ else
EXISTING_VERSION="0.0.0"
fi

rsync_with_progress() {
stdbuf -i0 -o0 -e0 rsync -au --info=progress2 "$@" | stdbuf -i0 -o0 -e0 tr '\r' '\n' | stdbuf -i0 -o0 -e0 grep -oP '\d+%|\d+.\d+[mMgG]' | tqdm --bar-format='{l_bar}{bar}' --total=100 --unit='%' > /dev/null
}

sync_apps() {
# Only sync if the DISABLE_SYNC environment variable is not set
if [ -z "${DISABLE_SYNC}" ]; then
# Sync application to workspace to support Network volumes
echo "Syncing ${APP} to workspace, please wait..."
mv /${APP} /workspace/${APP}

# Sync Application Manager to workspace to support Network volumes
echo "Syncing Application Manager to workspace, please wait..."
mv /app-manager /workspace/app-manager

rsync_with_progress --remove-source-files /${APP}/ /workspace/${APP}/
echo "${TEMPLATE_VERSION}" > ${DOCKER_IMAGE_VERSION_FILE}
fi
}
Expand Down Expand Up @@ -51,7 +50,7 @@ else
fi

# Start application manager
cd /workspace/app-manager
cd /app-manager
npm start > /workspace/logs/app-manager.log 2>&1 &

if [[ ${DISABLE_AUTOLAUNCH} ]]
Expand Down

0 comments on commit df5cddf

Please sign in to comment.