There is a gitlab, you need to run such a bash script after pushing, for example, to the master branch
#!/bin/bash git archive --remote=/repositories/myproject.git master | tar -x -C /www/myproject/ forever stop "myproject" cd /www/myproject export NODE_PATH=. export NODE_ENV=qa export NODE_INIT_TARGET=build node --use_strict bin/init forever start -a --uid "myproject" --minUptime 5000 --spinSleepTime 5000 bin/start --use_strict exit 0 Here, node --use_strict bin/init starts the build of the project (front-end) before starting.
Now this is all twitching with a post-recive hook - a php-script, while only git archive ... works git archive ... , all that is not performed further. The question is why? How to make it work?
Immediately, I will say that maybe a web hook is garbage? Maybe somewhere you can shove this bash script into a gitlab, and execute it without any http requests directly on the server? ps the last option would be perfect) Tell me how to solve the problem? Maybe somehow you can use gitlab?
post-receivehook? By the way, how did you determine that it was after that line that everything stopped? And here is an interesting reading: help.github.com/enterprise/2.8/admin/guides/developer-workflow/… - 0andriy