The elusive post-receive example that I so often need
perfect
1 file changed, +6 -5
+6-5post-receive
| @@ -2,14 +2,15 @@ | ||
| 2 | 2 | |
| 3 | 3 | # define the project details |
| 4 | 4 | project=vflcountdown |
| 5 | -base='/web/$project' | |
| 5 | +base=/web/$project | |
| 6 | 6 | |
| 7 | 7 | while read oldrev newrev refname |
| 8 | 8 | do |
| 9 | 9 | branch=`echo "$refname" | sed 's:.*/::'` |
| 10 | - worktree='$base/$project-$branch' | |
| 11 | - git --work-tree=$worktree --git-dir=$base.git checkout -f $branch | |
| 10 | + worktree=$base/$project-$branch | |
| 11 | + echo $worktree | |
| 12 | + mkdir -p $worktree | |
| 13 | + git --work-tree=$worktree --git-dir=$base checkout -f $branch | |
| 12 | 14 | cd $worktree |
| 13 | - # project commands | |
| 14 | - npm run build | |
| 15 | + bash entrypoint.sh | |
| 15 | 16 | done |