A
A
Al2017-02-09 23:59:11
linux
Al, 2017-02-09 23:59:11

How to launch forever after pushing to a specific branch?

There is gitlab, you need to execute 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 building the project (front-end) before starting.
Now it's all twitched by a post-recive hook - a php script, while it only works about git archive ... , everything that is further is not executed. The question is why? How to make it work?
Right there, I’ll say that maybe a webhook is garbage? Maybe somewhere you can shove this bash script into gitlab, and execute it without any http requests directly on the server? ps the last option would be ideal) Tell me how to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2017-02-10
@jcmvbkbc

in this case, only git archive ... works, everything else is not executed. The question is why?

Something tells me that forever never ends. And by the way, why is he here?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question