fix deploy

This commit is contained in:
2025-04-12 22:00:12 +02:00
parent 116458feda
commit d9ae5f8c2b

View File

@@ -5,9 +5,14 @@ $remoteHost = "robe.vincent-bouquet.fr"
$remotePath = "/var/www/html/public/reap" $remotePath = "/var/www/html/public/reap"
$port = 22 # Change this if your SSH server uses a different port $port = 22 # Change this if your SSH server uses a different port
# Build the SCP command # Build the SCP commands
$copyCommand = "scp -r -P ${port} `"${localFolder}`" ${remoteUser}@${remoteHost}:`"${remotePath}`"" $sshCommand = "ssh -p ${port} ${remoteUser}@${remoteHost} 'mkdir -p `"${remotePath}`" && sudo rm -rf `"${remotePath}/*`"'"
$scpCommand = "scp -r -P ${port} `"${localFolder}`" ${remoteUser}@${remoteHost}:`"${remotePath}`""
# Execute SSH command to clean remote directory
Write-Host "Cleaning remote directory: $remotePath"
Invoke-Expression $sshCommand
# Execute the command # Execute the command
Write-Host "Executing: $copyCommand" Write-Host "Executing: $scpCommand"
Invoke-Expression $copyCommand Invoke-Expression $scpCommand