ptut-virtenv/metactl/pre-start.sh

33 lines
1.2 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
source $(dirname `realpath $0`)/environment.sh;
##############################################
## ##
## 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";
# 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";
# 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";
# 3. Create 'env' spy
echo -ne " * Launch 'env' spy..........";
2018-02-19 20:40:05 +00:00
( bash $ROOT/ci/env.sh )&
echo "launched";
echo -n "$!" > $ROOT/ci/env.pid;
# 3. Create 'web' spy
echo -ne " * Launch 'web' spy..........";
2018-02-19 20:40:05 +00:00
( bash $ROOT/ci/web.sh )&
echo "launched";
echo -n "$!" > $ROOT/ci/web.pid;