linux deploy script

This commit is contained in:
2023-07-31 21:40:39 +03:00
parent c5d9ae7b93
commit 33aa0ef807
6 changed files with 21 additions and 82 deletions
+19
View File
@@ -0,0 +1,19 @@
host=$1
servicename=$2
path=$3
clear
echo "-= SERVICE STOP =-"
ssh root@$host ''systemctl is-active $servicename''
ssh root@$host ''systemctl stop $servicename''
ssh root@$host ''systemctl is-active $servicename''
echo "-= COPY FILES =-"
rsync -r --info=progress2 --exclude appsettings*.json _Published/ root@$host:$path
rsync -r --ignore-existing --info=progress2 _Published/appsettings*.json root@$1:$path
echo "-= SERVICE START =-"
ssh root@$host ''systemctl start $servicename''
echo "-= SERVICE STATUS =-"
ssh root@$host ''systemctl status $servicename''