diff --git a/.vscode/settings.json b/.vscode/settings.json index 14e7153..219cf49 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -144,5 +144,8 @@ "components/x-date-pickers/locales" ], "i18n-ally.keystyle": "nested", - "i18n-ally.sourceLanguage": "bg" + "i18n-ally.sourceLanguage": "bg", + "[shellscript]": { + "editor.defaultFormatter": "foxundermoon.shell-format" + } } \ No newline at end of file diff --git a/_deploy/entrypoint.sh b/_deploy/entrypoint.sh index 2917ccf..a5ed376 100644 --- a/_deploy/entrypoint.sh +++ b/_deploy/entrypoint.sh @@ -8,6 +8,7 @@ if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then # Create a temporary directory for the new clone rm -rf /tmp/clone mkdir /tmp/clone + mkdir -p /app/logs # Clone the repository echo "\r\n\r\n Cloning repository..." | tee -a /app/logs/deploy.txt @@ -16,7 +17,24 @@ if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then # Synchronize all files except package.json, package-lock.json, and the contents of /public/content # rsync -av --filter='P /public/content/' --exclude 'package.json' --exclude 'package-lock.json' /tmp/clone/ /app/ || echo "Rsync failed: Issue synchronizing files" echo "\r\n\r\n Synchronizing files..." - rsync -av --exclude '/public/content' --exclude 'package.json' --exclude 'package-lock.json' /tmp/clone/ /app/ || echo "Rsync failed: Issue synchronizing files" | tee -a /app/logs/deploy.txt + # rsync -av --exclude '/public/content' --exclude 'package.json' --exclude 'package-lock.json' /tmp/clone/ /app/ || echo "Rsync failed: Issue synchronizing files" | tee -a /app/logs/deploy.txt + + # Clear previous log + echo "Starting sync process at $(date)" > /app/logs/deploy.txt + + # Run rsync with verbose output and itemize-changes + rsync -av --itemize-changes --exclude 'public/content' --exclude 'package.json' --exclude 'package-lock.json' /tmp/clone/ /app/ >> /app/logs/deploy.txt 2>&1 + + # Check rsync exit status + if [ $? -ne 0 ]; then + echo "Rsync failed: Issue synchronizing files" | tee -a /app/logs/deploy.txt + cat /app/logs/deploy.txt # Display the log contents + else + echo "Rsync completed successfully" | tee -a /app/logs/deploy.txt + echo "Last few lines of rsync log:" | tee -a /app/logs/deploy.txt + tail -n 20 /app/logs/deploy.txt # Display the last 20 lines of the log + fi + echo "\r\n\r\n Checking for changes in package files..."