|
@ -8,6 +8,11 @@ if [ "$GIT_TUTOR" ] ; then |
|
|
REPO=${GIT_TUTOR##*/} |
|
|
REPO=${GIT_TUTOR##*/} |
|
|
REPO=${REPO%.git} |
|
|
REPO=${REPO%.git} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PIPELINENAME=$(echo $TASKNAME | cut -d'.' -f1) |
|
|
|
|
|
|
|
|
|
|
|
SESSION=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '') |
|
|
|
|
|
|
|
|
# --------------------------- |
|
|
# --------------------------- |
|
|
# start playground |
|
|
# start playground |
|
|
# -------------------------- |
|
|
# -------------------------- |
|
@ -25,16 +30,16 @@ chmod +x /home/$USER/crond/playground-start.sh |
|
|
read -r -d '' VAR <<EOF |
|
|
read -r -d '' VAR <<EOF |
|
|
module.exports = { |
|
|
module.exports = { |
|
|
"apps": [{ |
|
|
"apps": [{ |
|
|
"name" : "playground-nodejs", |
|
|
"name" : "playground-nodejs-$PIPELINENAME", |
|
|
"autorestart" : true, |
|
|
"autorestart" : true, |
|
|
"watch" : true, |
|
|
"watch" : true, |
|
|
"script" : "/home/$USER/$REPO/swarmlab-app/src/run/app.js", |
|
|
"script" : "/home/$USER/$REPO/swarmlab-app/src/run/app.js", |
|
|
"args" : "start", |
|
|
"args" : "start", |
|
|
"pid_file" : "/home/$USER/run/pid.pid", |
|
|
"pid_file" : "/home/$USER/run/pid.pid", |
|
|
"log_type" : "json", |
|
|
"log_type" : "json", |
|
|
"log_file" : "/home/$USER/log/logfile", |
|
|
"log_file" : "/home/$USER/log/$PIPELINENAME-$SESSION-log", |
|
|
"error_file" : "/home/$USER/log/errorfile", |
|
|
"error_file" : "/home/$USER/log/$PIPELINENAME-$SESSION-error", |
|
|
"out_file" : "/home/$USER/log/outfile", |
|
|
"out_file" : "/home/$USER/log/$PIPELINENAME-$SESSION-output", |
|
|
"log_date_format": "YYYY-MM-DD HH:mm Z", |
|
|
"log_date_format": "YYYY-MM-DD HH:mm Z", |
|
|
"env" : { |
|
|
"env" : { |
|
|
"NODE_PATH": "/home/$USER/$REPO/swarmlab-app/src/node_modules", |
|
|
"NODE_PATH": "/home/$USER/$REPO/swarmlab-app/src/node_modules", |
|
|