1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00
fcast/receivers/electron/deploy.sh

33 lines
842 B
Bash
Raw Permalink Normal View History

2023-06-20 08:45:01 +02:00
#!/bin/sh
2023-06-28 12:23:38 +02:00
DOCUMENT_ROOT=/var/www/html
# Build content
echo "Building content..."
2023-06-20 08:45:01 +02:00
npm install
2023-06-28 12:23:38 +02:00
cd packaging
sh package-all.sh
# Take site offline
echo "Taking site offline..."
touch $DOCUMENT_ROOT/maintenance.file
# Swap over the content
echo "Deploying content..."
cp fcast-receiver-*.zip $DOCUMENT_ROOT/fcastreceiver/
cd ..
cp package.json $DOCUMENT_ROOT/fcastreceiver/
cp -r dist $DOCUMENT_ROOT/fcastreceiver/
# Notify Cloudflare to wipe the CDN cache
echo "Purging Cloudflare cache..."
2023-06-28 12:56:19 +00:00
curl -X POST "https://api.cloudflare.com/client/v4/zones/ff904f7348b9513064b23e852e328abb/purge_cache" \
2023-06-28 12:23:38 +02:00
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
2023-06-28 12:56:19 +00:00
sleep 30
2023-06-28 12:23:38 +02:00
# Take site back online
echo "Bringing site back online..."
2023-06-28 12:56:19 +00:00
rm $DOCUMENT_ROOT/maintenance.file