Innovenergy_trunk/csharp/App/SaliMax/deploy.sh

27 lines
781 B
Bash
Raw Normal View History

2023-07-13 07:42:50 +00:00
#!/bin/bash
dotnet_version='net6.0'
salimax_ip="$1"
2023-07-13 07:42:50 +00:00
username='ie-entwicklung'
2024-03-20 13:53:36 +00:00
root_password='Salimax4x25'
2023-07-13 07:42:50 +00:00
set -e
echo -e "\n============================ Build ============================\n"
dotnet publish \
./SaliMax.csproj \
-p:PublishTrimmed=false \
-c Release \
-r linux-x64
echo -e "\n============================ Deploy ============================\n"
rsync -v \
2023-08-23 14:11:50 +00:00
--exclude '*.pdb' \
2023-07-13 07:42:50 +00:00
./bin/Release/$dotnet_version/linux-x64/publish/* \
2023-08-18 13:57:00 +00:00
$username@"$salimax_ip":~/salimax
2024-03-20 13:53:36 +00:00
echo -e "\n============================ Execute ============================\n"
2024-03-20 13:53:36 +00:00
sshpass -p "$root_password" ssh -o StrictHostKeyChecking=no -t "$username"@"$salimax_ip" "echo '$root_password' | sudo -S sh -c 'cd salimax && ./restart'" 2>/dev/null