2023-11-29 20:28:11 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
dotnet_version='net6.0'
|
|
|
|
salimax_ip="$1"
|
|
|
|
username='ie-entwicklung'
|
|
|
|
root_password='Salimax4x25'
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo -e "\n============================ Build ============================\n"
|
|
|
|
|
|
|
|
dotnet publish \
|
|
|
|
./SaliMax.csproj \
|
|
|
|
-p:PublishTrimmed=false \
|
|
|
|
-c Release \
|
|
|
|
-r linux-x64
|
|
|
|
|
|
|
|
echo -e "\n============================ Deploy ============================\n"
|
2024-05-10 17:16:16 +00:00
|
|
|
#ip_addresses=("10.2.3.115" "10.2.3.104" "10.2.4.33" "10.2.4.32" "10.2.4.36" "10.2.4.35" "10.2.4.154" "10.2.4.113" "10.2.4.29")
|
2024-05-07 15:19:02 +00:00
|
|
|
#ip_addresses=("10.2.4.154" "10.2.4.29")
|
2024-05-10 17:16:16 +00:00
|
|
|
ip_addresses=("10.2.3.115" "10.2.3.104" "10.2.4.33" "10.2.4.32" "10.2.4.36" "10.2.4.35" "10.2.4.154" "10.2.4.29")
|
|
|
|
|
2024-05-07 15:19:02 +00:00
|
|
|
|
2024-04-30 09:43:10 +00:00
|
|
|
|
2023-11-29 20:28:11 +00:00
|
|
|
for ip_address in "${ip_addresses[@]}"; do
|
|
|
|
rsync -v \
|
|
|
|
--exclude '*.pdb' \
|
|
|
|
./bin/Release/$dotnet_version/linux-x64/publish/* \
|
|
|
|
$username@"$ip_address":~/salimax
|
2024-03-20 13:53:36 +00:00
|
|
|
|
2023-11-29 20:28:11 +00:00
|
|
|
ssh "$username"@"$ip_address" "cd salimax && echo '$root_password' | sudo -S ./restart"
|
|
|
|
|
2024-03-20 13:53:36 +00:00
|
|
|
echo "Deployed and ran commands on $ip_address"
|
2023-11-29 20:28:11 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|