From 98a7073b3ad466cf83a57007cb9785ab057dddf9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 24 Mar 2022 18:42:43 -0400 Subject: [PATCH] combine ssh commands for deployment --- deploy-static | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/deploy-static b/deploy-static index efc5ea5d..6b862874 100755 --- a/deploy-static +++ b/deploy-static @@ -24,18 +24,14 @@ for server in ${servers[@]}; do echo target is $target echo - ssh $remote rm -rf $target - ssh $remote cp -a $active $target + ssh $remote "rm -rf $target && cp -a $active $target" rsync -rptcv --chmod=D755,F644 --delete static-tmp/ $remote:$target - ssh $remote sync -f $target - ssh $remote ln -snf $target /srv/grapheneos.org - ssh $remote sync /srv/grapheneos.org + ssh $remote "sync -f $target && ln -snf $target /srv/grapheneos.org && sync /srv/grapheneos.org" sed "s|/srv/grapheneos.org|$target|" nginx-tmp/nginx.conf > nginx-tmp/nginx.conf.root rsync -rptcv --chmod=D755,F644 --delete nginx-tmp/nginx.conf.root $remote:/etc/nginx/nginx.conf rsync -rptcv --chmod=D755,F644 --delete nginx-tmp/snippets/ $remote:/etc/nginx/snippets - ssh $remote 'sync /etc/nginx/nginx.conf /etc/nginx/snippets/*' - ssh $remote nginx -s reload + ssh $remote "sync /etc/nginx/nginx.conf /etc/nginx/snippets/* && nginx -s reload" echo echo active is now $target