Changeset d2b7247 in Klonkt for deploy/post-receive
- Timestamp:
- 06/27/2026 09:53:29 PM (2 months ago)
- Branches:
- main
- Children:
- 907a013
- Parents:
- abdcf33
- File:
-
- 1 edited
-
deploy/post-receive (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
deploy/post-receive
rabdcf33 rd2b7247 1 1 #!/bin/bash 2 # PrutFolio deploy-hook — werkt zoals logboek-hook.3 # Bare repo issingle source of truth.4 # /srv/prutfolio is de working tree — gevuld via "git --work-tree=..."5 # ( geen .git submap erin), zelfde patroon als logboek->celine.2 # Klonkt deploy hook — works like the logboek hook. 3 # The bare repo is the single source of truth. 4 # /srv/prutfolio is the working tree — populated via "git --work-tree=..." 5 # (no .git subdir inside), same pattern as logboek->celine. 6 6 set -e 7 7 … … 14 14 echo ">>> Deploying $newrev to $DEPLOY" 15 15 16 # 1. Heel zelden — als een eerdere bug git-internals los in $DEPLOY17 # heeft gedumpt (HEAD/objects/refs op root), eenmalig opruimen18 # zodat dit een echte working tree wordt.16 # 1. Very rarely — if an earlier bug dumped git internals loose into 17 # $DEPLOY (HEAD/objects/refs at the root), clean them up once so this 18 # becomes a real working tree. 19 19 if [ -f "$DEPLOY/HEAD" ] && [ -d "$DEPLOY/objects" ] && [ ! -d "$DEPLOY/.git" ]; then 20 20 echo " cleanup: stale bare-init artifacts in $DEPLOY" … … 24 24 fi 25 25 26 # 2. Force-checkout van bare-repo state naarworking tree.26 # 2. Force-checkout the bare-repo state into the working tree. 27 27 git --git-dir="$GIT_DIR" --work-tree="$DEPLOY" checkout -f main 28 28 29 # 3. npm install alleen als package-lock.json wijzigde.29 # 3. npm install only when package-lock.json changed. 30 30 if [ -n "$oldrev" ] && [ "$oldrev" != "0000000000000000000000000000000000000000" ]; then 31 31 if git --git-dir="$GIT_DIR" diff --name-only "$oldrev" "$newrev" | grep -q "^package-lock.json$"; then … … 38 38 pm2 reload klonkt 2>/dev/null || true 39 39 40 echo ">>> Done. App -files in $DEPLOY ongemoeid (.env, node_modules, storage)."40 echo ">>> Done. App files in $DEPLOY left untouched (.env, node_modules, storage)." 41 41 done
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)