test
This commit is contained in:
@ -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..."
|
||||
|
Reference in New Issue
Block a user