modules: vak- en personen-wizard + import
This commit is contained in:
parent
aa90a93648
commit
f0c7b3644f
3 changed files with 105 additions and 0 deletions
33
DEPLOY.md
33
DEPLOY.md
|
|
@ -1,3 +1,36 @@
|
|||
# Deploy-workflow (kort)
|
||||
|
||||
> **Belangrijk — gebruik de scripts.** Eerdere mislukte pushes kwamen door een
|
||||
> achtergebleven `.git/index.lock` die `git commit` blokkeerde (dan valt er
|
||||
> niets te pushen en zegt git "up-to-date"). De scripts ruimen dat automatisch
|
||||
> op en **controleren** of de push echt is doorgekomen.
|
||||
|
||||
**1. Op je dev-machine** (Windows / PowerShell), in de repo-map:
|
||||
|
||||
```powershell
|
||||
.\scripts\push.ps1 "korte omschrijving van de wijziging"
|
||||
```
|
||||
|
||||
Dit verwijdert een eventuele lock, commit (alleen als er iets is), pusht naar
|
||||
`origin/<branch>` en meldt **OK** of **LET OP** (met reden) — geen stille
|
||||
mislukkingen meer. Krijg je "LET OP", dan staat de oorzaak in de git-uitvoer
|
||||
erboven (meestal een SSH-/sleutelprobleem).
|
||||
|
||||
**2. Op de test-server**, in de repo-map:
|
||||
|
||||
```bash
|
||||
./scripts/deploy.sh
|
||||
```
|
||||
|
||||
Dit haalt de laatste code op (`git reset --hard origin/<branch>`), herbouwt de
|
||||
containers (incl. migraties via de entrypoint) en controleert of er een nieuwe
|
||||
frontend-bundel staat.
|
||||
|
||||
Nieuwe **modules** verschijnen daarna pas in de app nadat je ze aanzet via
|
||||
**⚙ → Modulebeheer**.
|
||||
|
||||
---
|
||||
|
||||
# Draaien op de test-server (Docker)
|
||||
|
||||
De stack bestaat uit drie containers:
|
||||
|
|
|
|||
19
scripts/deploy.sh
Normal file
19
scripts/deploy.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
# Op de test-server: haal de laatste code op en herbouw de containers.
|
||||
# Gebruik: ./scripts/deploy.sh
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
echo "Branch: $branch"
|
||||
git fetch origin
|
||||
# Forceer exact gelijk aan de remote (voorkomt 'already up to date'-verwarring).
|
||||
git reset --hard "origin/$branch"
|
||||
echo "Nu op commit:"
|
||||
git --no-pager log --oneline -1
|
||||
|
||||
docker compose up -d --build
|
||||
|
||||
echo "Controle: nieuwe frontend-bundel aanwezig?"
|
||||
docker compose exec -T nginx sh -c 'ls /usr/share/nginx/html/assets/*.js >/dev/null 2>&1 && echo " frontend OK" || echo " GEEN frontend-bundel gevonden"'
|
||||
echo "Klaar."
|
||||
53
scripts/push.ps1
Normal file
53
scripts/push.ps1
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Veilig committen + pushen vanaf de dev-machine (Windows / PowerShell).
|
||||
# Gebruik: .\scripts\push.ps1 "mijn commit-bericht"
|
||||
# Lost het terugkerende push-probleem op: ruimt een achtergebleven
|
||||
# index.lock op, commit alleen als er iets te committen valt, pusht, en
|
||||
# CONTROLEERT daarna of de remote echt is bijgewerkt.
|
||||
param([string]$Bericht = "")
|
||||
|
||||
$ErrorActionPreference = "Continue"
|
||||
# Ga naar de repo-root (map boven dit script).
|
||||
Set-Location (Split-Path $PSScriptRoot -Parent)
|
||||
|
||||
# 1) Eventuele achtergebleven lock weghalen (oorzaak van mislukte commits).
|
||||
if (Test-Path ".git\index.lock") {
|
||||
Remove-Item ".git\index.lock" -Force
|
||||
Write-Host "Verwijderd: achtergebleven .git\index.lock" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# 2) Huidige branch bepalen.
|
||||
$branch = (git rev-parse --abbrev-ref HEAD).Trim()
|
||||
Write-Host "Branch: $branch"
|
||||
|
||||
# 3) Alles toevoegen en committen (alleen als er wijzigingen zijn).
|
||||
git add -A
|
||||
$status = git status --porcelain
|
||||
if ([string]::IsNullOrWhiteSpace($status)) {
|
||||
Write-Host "Geen wijzigingen om te committen." -ForegroundColor Yellow
|
||||
} else {
|
||||
if ([string]::IsNullOrWhiteSpace($Bericht)) {
|
||||
$Bericht = "Update " + (Get-Date -Format "yyyy-MM-dd HH:mm")
|
||||
}
|
||||
git commit -m $Bericht
|
||||
if ($LASTEXITCODE -ne 0) { Write-Host "Commit MISLUKT." -ForegroundColor Red; exit 1 }
|
||||
}
|
||||
|
||||
# 4) Pushen.
|
||||
git push origin $branch
|
||||
$pushExit = $LASTEXITCODE
|
||||
|
||||
# 5) Controleren of de remote echt gelijk is aan lokaal.
|
||||
git fetch origin 2>$null | Out-Null
|
||||
$lokaal = (git rev-parse HEAD).Trim()
|
||||
$remote = (git rev-parse "origin/$branch").Trim()
|
||||
Write-Host ""
|
||||
if ($pushExit -eq 0 -and $lokaal -eq $remote) {
|
||||
Write-Host "OK - origin/$branch is bijgewerkt naar $($lokaal.Substring(0,8))." -ForegroundColor Green
|
||||
Write-Host "Draai nu op de test-server: ./scripts/deploy.sh"
|
||||
} else {
|
||||
Write-Host "LET OP - de push is NIET doorgekomen." -ForegroundColor Red
|
||||
Write-Host " lokaal : $lokaal"
|
||||
Write-Host " origin : $remote"
|
||||
Write-Host "Bekijk de git-uitvoer hierboven (vaak een sleutel-/authenticatieprobleem)." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Loading…
Reference in a new issue