+upd metactl.scripts now launches CI for env & web in background (pre-start, killed in post-stop)

This commit is contained in:
xdrm-brackets 2018-02-19 21:33:19 +01:00
parent 9ba0eef9c5
commit e50e67fbf4
3 changed files with 54 additions and 3 deletions

View File

@ -48,7 +48,11 @@ if [ "$DUMP_FILE_EXISTS" = "0" ]; then
else else
echo "missing"; ec @echo -n "*** Create trigger.............";
@test ! -d ./virtual/ci && mkdir ./virtual/ci; (exit 0);
@chmod 777 ./virtual/ci; (exit 0);
@touch ./virtual/ci/trigger; echo "done";
@chmod 777 ./virtual/ci/trigger; (exit 0);ho "missing";
# Create 'persistent' directory if missing # Create 'persistent' directory if missing
test ! -d $ROOT/persistent && mkdir -p $ROOT/persistent; test ! -d $ROOT/persistent && mkdir -p $ROOT/persistent;

View File

@ -7,3 +7,23 @@ source $(dirname `realpath $0`)/environment.sh;
## Executed after stopping containers ## ## Executed after stopping containers ##
## ## ## ##
############################################ ############################################
# 1. Stop 'env' spy
echo -ne " * Kill 'env' spy............";
PID_FILE="$ROOT/ci/env.pid";
if [ -f $PID_FILE ]; then
kill -9 `cat $PID_FILE` 2>/dev/null && echo "killed" || (echo "fail"; exit 1);
else
echo "already";
fi;
rm $PID_FILE >/dev/null 2>&1;
# 2. Stop 'web' spy
echo -ne " * Kill 'web' spy............";
PID_FILE="$ROOT/ci/web.pid";
if [ -f $PID_FILE ]; then
kill -9 `cat $PID_FILE` 2>/dev/null && echo "killed" || (echo "fail"; exit 1);
else
echo "already";
fi;
rm $PID_FILE >/dev/null 2>&1;

View File

@ -7,3 +7,30 @@ source $(dirname `realpath $0`)/environment.sh;
## Executed before launching containers ## ## Executed before launching containers ##
## ## ## ##
############################################## ##############################################
# 1. Create CI folder
echo -ne " * Create CI control folder..";
test ! -d `dirname $ROOT`/virtual/ci && ( mkdir -p `dirname $ROOT`/virtual/ci && echo "created" || (echo "failed"; exit 1) ) || echo "already";
chmod o=rx `dirname $ROOT`/virtual/ci;
# 2. Create 'env' trigger
echo -ne " * Create 'env' trigger......";
test ! -f `dirname $ROOT`/virtual/ci/env && ( touch `dirname $ROOT`/virtual/ci/env && echo "created" || (echo "failed"; exit 1)) || echo "already";
chmod o+rwx `dirname $ROOT`/virtual/ci/env;
# 3. Create 'web' trigger
echo -ne " * Create 'web' trigger......";
test ! -f `dirname $ROOT`/virtual/ci/web && ( touch `dirname $ROOT`/virtual/ci/web && echo "created" || (echo "failed"; exit 1)) || echo "already";
chmod o+rwx `dirname $ROOT`/virtual/ci/web;
# 3. Create 'env' spy
echo -ne " * Launch 'env' spy..........";
( sh $ROOT/ci/env.sh )&
echo "launched";
echo -n "$!" > $ROOT/ci/env.pid;
# 3. Create 'web' spy
echo -ne " * Launch 'web' spy..........";
( sh $ROOT/ci/web.sh )&
echo "launched";
echo -n "$!" > $ROOT/ci/web.pid;