combine ssh commands for deployment

This commit is contained in:
Daniel Micay 2022-03-24 18:42:43 -04:00
parent 0028001a2a
commit 98a7073b3a

View File

@ -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