change entrypoint script to avoid wiping uploads folder everytime

This commit is contained in:
Dobromir Popov
2024-07-05 18:15:50 +03:00
parent aefc4c6ceb
commit 5c78e561ee
2 changed files with 9 additions and 7 deletions

View File

@ -12,8 +12,9 @@ if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then
# Clone the repository
git clone -b ${GIT_BRANCH:-main} --depth 1 https://$GIT_USERNAME:${GIT_PASSWORD//@/%40}@git.d-popov.com/popov/mwitnessing.git /tmp/clone || exit 1
# Synchronize all files except package.json and package-lock.json to /app
rsync -av --delete --exclude 'package.json' --exclude 'package-lock.json' /tmp/clone/ /app/ || echo "Rsync failed: Issue synchronizing files"
# Synchronize all files except package.json and package-lock.json to /app. alo exclude '/app/public/content/uploads' to avoid deleting uploaded files
rsync -av --delete --exclude 'package.json' --exclude 'package-lock.json' --exclude '/app/public/content/uploads'
/tmp/clone/ /app/ || echo "Rsync failed: Issue synchronizing files"
# Determine if package.json or package-lock.json has changed
PACKAGE_CHANGE=0