This commit is contained in:
@@ -188,13 +188,28 @@ jobs:
|
|||||||
# Make script executable and copy to server
|
# Make script executable and copy to server
|
||||||
chmod +x /tmp/deploy.sh
|
chmod +x /tmp/deploy.sh
|
||||||
|
|
||||||
# Copy deployment script to server
|
# Copy deployment script to server with keep-alive and timeout
|
||||||
scp -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 /tmp/deploy.sh deploy@alpha.mintel.me:/tmp/deploy.sh
|
scp -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o ConnectTimeout=30 /tmp/deploy.sh deploy@alpha.mintel.me:/tmp/deploy.sh
|
||||||
|
|
||||||
# Execute deployment script on server
|
# Execute deployment script on server with keep-alive and timeout
|
||||||
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 deploy@alpha.mintel.me "
|
# Retry up to 3 times if connection is lost
|
||||||
set -e
|
for i in {1..3}; do
|
||||||
bash /tmp/deploy.sh
|
echo "Attempt $i of 3..."
|
||||||
"
|
if ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o ConnectTimeout=30 -o ServerAliveTimeout=300 deploy@alpha.mintel.me "
|
||||||
|
set -e
|
||||||
|
bash /tmp/deploy.sh
|
||||||
|
"; then
|
||||||
|
echo "✓ Deployment successful on attempt $i"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "✗ Deployment failed on attempt $i"
|
||||||
|
if [ $i -eq 3 ]; then
|
||||||
|
echo "All deployment attempts failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Retrying in 10 seconds..."
|
||||||
|
sleep 10
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
echo "Deployment completed"
|
echo "Deployment completed"
|
||||||
Reference in New Issue
Block a user