experiment
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then
|
if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then
|
||||||
# Install necessary packages
|
# Install necessary packages
|
||||||
apk add git nano rsync
|
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
|
# Create a temporary directory for the new clone
|
||||||
rm -rf /tmp/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
|
# 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"
|
# 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..."
|
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
|
# Clear previous log
|
||||||
echo "Starting sync process at $(date)" > /app/logs/deploy.txt
|
echo "Starting sync process at $(date)" > /app/logs/deploy.txt
|
||||||
|
|
||||||
# Run rsync with verbose output and itemize-changes
|
# 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
|
# Check rsync exit status
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@ -60,7 +60,7 @@ if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then
|
|||||||
npx next build
|
npx next build
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -rf /tmp/clone
|
# rm -rf /tmp/clone
|
||||||
echo "Update process completed."
|
echo "Update process completed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user