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

Gitlab CI Testing

This commit is contained in:
Michael Hollister 2024-09-17 09:33:18 -05:00
parent bbebe3c3d5
commit 4176e86c87

View file

@ -1,32 +1,8 @@
#!/bin/sh
DOCUMENT_ROOT=/var/www/html
# CI/CD WIP
# Build content
echo "Building content..."
npm install
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..."
curl -X POST "https://api.cloudflare.com/client/v4/zones/ff904f7348b9513064b23e852e328abb/purge_cache" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
sleep 30
# Take site back online
echo "Bringing site back online..."
rm $DOCUMENT_ROOT/maintenance.file
npm run make