Use temp directory for static deployments

This commit is contained in:
Florine W. Dekker 2021-04-14 19:13:24 +02:00
parent 9a8f3f270c
commit 52995adc46
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
1 changed files with 15 additions and 3 deletions

View File

@ -1,9 +1,21 @@
#!/usr/local/bin/bash #!/usr/local/bin/bash
# $1 = source # $1 = source
# $2 = destination # $2 = destination
# $3 = temp dir
mkdir -p "$2" while [ -e "$3" ]
git clone "$1" "$2" do
rm -rf "$2/.git/" echo "Waiting for another process to finish deploying..."
sleep 3
done
mkdir -p "$2" "$3"
git clone "$1" "$3"
rm -rf "$3/.git/"
cp -r "$3" "$2"
chmod -R g+w "$2" chmod -R g+w "$2"
rm -rf "$3"