experiment
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then
|
||||
# Install necessary packages
|
||||
apk add git nano rsync
|
||||
echo "Updating code from git.d-popov.com...(as '$GIT_USERNAME')"
|
||||
echo "Updating code from git.d-popov.com...(as '$GIT_USERNAME')" > /app/logs/deploy.txt
|
||||
|
||||
# Create a temporary directory for the new clone
|
||||
rm -rf /tmp/clone
|
||||
@ -17,13 +17,13 @@ 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 --update --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
|
||||
rsync -av --update --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
|
||||
@ -60,7 +60,7 @@ if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then
|
||||
npx next build
|
||||
|
||||
# Clean up
|
||||
rm -rf /tmp/clone
|
||||
# rm -rf /tmp/clone
|
||||
echo "Update process completed."
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user