This commit is contained in:
1 parent
2b766bfd13
commit
933060208f
1 file changed
+15
-12
@@ -24,7 +24,7 @@ jobs:
|
||||
}
|
||||
trap 'error_handler $LINENO' ERR
|
||||
|
||||
# Maak permanente mappen aan buiten het project voor je uploads en afbeeldingen
|
||||
# Zorg dat de permanente opslagmappen buiten het project correct bestaan
|
||||
sudo mkdir -p /var/www/atom-media/uploads
|
||||
sudo mkdir -p /var/www/atom-media/imaging
|
||||
sudo chown -R www-data:www-data /var/www/atom-media
|
||||
@@ -39,16 +39,14 @@ jobs:
|
||||
git fetch origin --prune
|
||||
git reset --hard origin/main
|
||||
|
||||
# Sluit de specifieke mediamappen uit van git clean zodat de lokale links blijven bestaan
|
||||
git clean -fd -e .env -e .env.local -e .env.production -e .env*.local -e .next -e public/uploads -e public/imaging
|
||||
# Haal eventuele bestaande links/mappen weg in de werkmap om loops te voorkomen
|
||||
rm -rf public/uploads public/imaging
|
||||
|
||||
# Zorg dat de basismap public bestaat
|
||||
git clean -fd -e .env -e .env.local -e .env.production -e .env*.local -e .next
|
||||
|
||||
# Zorg dat de basismap public leeg en fris klaarstaat voor de build
|
||||
mkdir -p public
|
||||
|
||||
# Herstel symlinks in de hoofdmap indien nodig
|
||||
[ -L public/uploads ] || { rm -rf public/uploads && ln -s /var/www/atom-media/uploads public/uploads; }
|
||||
[ -L public/imaging ] || { rm -rf public/imaging && ln -s /var/www/atom-media/imaging public/imaging; }
|
||||
|
||||
# Verwijder oude builds, behoud de cache voor snelheid
|
||||
find .next -mindepth 1 -maxdepth 1 ! -name 'cache' -exec rm -rf {} + 2>/dev/null || true
|
||||
|
||||
@@ -79,12 +77,12 @@ jobs:
|
||||
cp -r node_modules/@prisma .next/standalone/node_modules/ 2>/dev/null || true
|
||||
cp .env .next/standalone/.env
|
||||
|
||||
# Koppel de symlinks keihard binnen de vers gebouwde standalone public-map
|
||||
# Harde en veilige symlinks leggen (-sfn voorkomt nesten/loops)
|
||||
rm -rf .next/standalone/public/uploads
|
||||
ln -s /var/www/atom-media/uploads .next/standalone/public/uploads
|
||||
ln -sfn /var/www/atom-media/uploads .next/standalone/public/uploads
|
||||
|
||||
rm -rf .next/standalone/public/imaging
|
||||
ln -s /var/www/atom-media/imaging .next/standalone/public/imaging
|
||||
ln -sfn /var/www/atom-media/imaging .next/standalone/public/imaging
|
||||
|
||||
# 7. Permissions
|
||||
sudo chown -R www-data:www-data /var/www/atom-nexst/
|
||||
@@ -97,7 +95,12 @@ jobs:
|
||||
|
||||
sleep 3
|
||||
if ! systemctl is-active --quiet atom-nexst.service; then
|
||||
echo "ERROR: atom-nexst.service failed to start! Check logs using: journalctl -u atom-nexst.service" >&2
|
||||
echo "--------------------------------------------------------" >&2
|
||||
echo "CRITICAL ERROR: atom-nexst.service failed to start!" >&2
|
||||
echo "Dumping last 30 lines of systemd journal logs below:" >&2
|
||||
echo "--------------------------------------------------------" >&2
|
||||
sudo journalctl -u atom-nexst.service -n 30 --no-pager >&2
|
||||
echo "--------------------------------------------------------" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user