From 13e9af7d6ee0bfed15b63bf7e70608adc8fc7560 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 20 Feb 2018 14:14:23 +0100 Subject: [PATCH] +fix 'web' spy does nothing before 'docker-compose up' -> now in 'post-start' script --- metactl/ci/web.sh | 10 +++++----- metactl/post-start.sh | 13 ++++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/metactl/ci/web.sh b/metactl/ci/web.sh index 060a190..f4eb3af 100644 --- a/metactl/ci/web.sh +++ b/metactl/ci/web.sh @@ -15,6 +15,11 @@ TRIGGER="`realpath $ROOT/../../virtual/ci/web`"; while true; do + while [ -f $TRIGGER ]; do + sleep 1; + done; + + # 1. Go to root directory cd $ROOT/../..; @@ -32,9 +37,4 @@ while true; do # N. Recreate trigger test ! -f $TRIGGER && touch $TRIGGER; - - while [ -f $TRIGGER ]; do - sleep 1; - done; - done; \ No newline at end of file diff --git a/metactl/post-start.sh b/metactl/post-start.sh index 9fff605..1eeb1f3 100644 --- a/metactl/post-start.sh +++ b/metactl/post-start.sh @@ -68,4 +68,15 @@ fi; ## [3] Grant www-data for CI triggers echo -n " * Grant php on triggers....."; -docker exec php-fpm chown www-data -R /ci && echo "granted" || (echo "failed"; exit 1); \ No newline at end of file +docker exec php-fpm chown www-data -R /ci && echo "granted" || (echo "failed"; exit 1); + + +## [4] Update vhost libs/builds + +# 1. Update composer +echo -n " * Build composer............"; +docker exec php-fpm bash -c "cd /vhost; composer install" >/dev/null 2>&1 && echo "built" || (echo "failed"; exit 1); + +# 2. Re-build js/scss +echo -n " * Webpack build............."; +docker exec php-fpm bash -c "cd /vhost; npm install; npm run build" >/dev/null 2>&1 && echo "built" || (echo "failed"; exit 1); \ No newline at end of file