diff --git a/Server/bin/start_test b/Server/bin/start_test new file mode 100644 index 0000000..a0549bd --- /dev/null +++ b/Server/bin/start_test @@ -0,0 +1,5 @@ +#!/bin/sh +/sbin/pidof /home/ofbbutte/webapps/ofb_angular_test/bin/node > /dev/null 2>&1 && exit 0 +mkdir -p /home/ofbbutte/webapps/ofb_angular_test/run +nohup /home/ofbbutte/webapps/ofb_angular_test/bin/node /home/ofbbutte/webapps/ofb_angular_test/src/app.js > /dev/null 2>&1 & +/sbin/pidof /home/ofbbutte/webapps/ofb_angular_test/bin/node > /home/ofbbutte/webapps/ofb_angular_test/run/node.pid diff --git a/Server/bin/stop_test b/Server/bin/stop_test new file mode 100644 index 0000000..4f8b17d --- /dev/null +++ b/Server/bin/stop_test @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/pkill -f /home/ofbbutte/webapps/ofb_angular_test/bin/node && rm -f /home/ofbbutte/webapps/ofb_angular_test/run/node.pid diff --git a/git-post-receive b/git-post-receive index 7bd0fb8..3edc979 100644 --- a/git-post-receive +++ b/git-post-receive @@ -16,8 +16,6 @@ fi if [ "$BRANCH" = master ]; then cd /home/ofbbutte/webapps/ofb_angular_test/ fi -exit 1 - echo "Node Version" bin/node --version @@ -53,8 +51,14 @@ echo "Remove start and stop script files" rm -f bin/start rm -f bin/stop echo "Copying start and stop script files" -mv tempcheckout/Server/bin/start bin/start -mv tempcheckout/Server/bin/stop bin/stop +if [ "$BRANCH" = master ]; then + mv tempcheckout/Server/bin/start bin/start + mv tempcheckout/Server/bin/stop bin/stop +fi +if [ "$BRANCH" = test ]; then + mv tempcheckout/Server/bin/start_test bin/start + mv tempcheckout/Server/bin/stop_test bin/stop +fi ls echo "Modifying permissions on start and stop script files to be executable" chmod +x bin/start