Commit | Line | Data |
---|---|---|
f854c94f | 1 | ## V1: |
ec58aacc | 2 | #!/bin/sh |
5a958354 | 3 | # NOTE: the ssh part is not required if git repo and vchess are on the same server |
ec58aacc | 4 | ssh user@server -t 'cd /path/to/vchess/client && git pull && npm run build' |
f854c94f BA |
5 | |
6 | ## V2: | |
7 | #!/bin/sh | |
8 | cd /path/to/vchess || exit | |
9 | # See https://stackoverflow.com/questions/4043609/getting-fatal-not-a-git-repository-when-using-post-update-hook-to-execut | |
10 | unset GIT_DIR | |
11 | git pull | |
12 | clientLines=`git diff-tree --no-commit-id --name-only -r HEAD | grep client | wc -l` | |
13 | if [ $clientLines -ne 0 ]; then | |
14 | cd client | |
15 | npm run build | |
16 | fi | |
17 | # TOOD: also should restart the service if server code changes |