From 8b9aae6f2621fd3d8bfee9c0272926d4c47a56b9 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 19 Feb 2018 21:34:16 +0100 Subject: [PATCH] +created metactl.ci{env,web} spies + ignore pid files --- .gitignore | 3 ++- metactl/ci/env.sh | 29 +++++++++++++++++++++++++++++ metactl/ci/web.sh | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 metactl/ci/env.sh create mode 100644 metactl/ci/web.sh diff --git a/.gitignore b/.gitignore index 75400d5..b1964e2 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /Dockerfile /virtual/var/log /virtual/ci -/metactl/persistent/* \ No newline at end of file +/metactl/persistent/* +/metactl/ci/*.pid \ No newline at end of file diff --git a/metactl/ci/env.sh b/metactl/ci/env.sh new file mode 100644 index 0000000..750a5f4 --- /dev/null +++ b/metactl/ci/env.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +TMP="$(dirname `realpath $0`)"; +TMP="`dirname $TMP`"; +source $TMP/environment.sh; + +################################################# +## ## +## Executed on 'env' Coninuous Integration ## +## ## +################################################# + + +TRIGGER="`realpath $ROOT/../../virtual/ci/env`"; +while [ -f $TRIGGER ]; do + + sleep 1; + +done; + +# 1. Go to root directory +cd $ROOT/../..; + +# 2. Pull sources +git pull origin master; + +# 3. Stop environment +# 4. Rebuild environment +( make stop; make start ); \ No newline at end of file diff --git a/metactl/ci/web.sh b/metactl/ci/web.sh new file mode 100644 index 0000000..08f4501 --- /dev/null +++ b/metactl/ci/web.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +TMP="$(dirname `realpath $0`)"; +TMP="`dirname $TMP`"; +source $TMP/environment.sh; + +################################################# +## ## +## Executed on 'env' Coninuous Integration ## +## ## +################################################# + + +TRIGGER="`realpath $ROOT/../../virtual/ci/web`"; + +while true; do + + + while [ -f $TRIGGER ]; do + + sleep 1; + + done; + + # 1. Go to root directory + cd $ROOT/../..; + + # 2. Update submodule 'vhost' + git submodule update --remote; + + # ... + + # N. Recreate trigger + test ! -f $TRIGGER && touch $TRIGGER; + chmod o+rwx $TRIGGER; + + sleep 1; + +done; \ No newline at end of file