ptut-virtenv/metactl/ci/web.sh

41 lines
852 B
Bash

#!/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/../../virtual/vhost;
# 2. Update submodule 'vhost'
git checkout master;
git pull origin master;
# 3. Update composer
docker exec php-fpm bash -c "cd /vhost; composer install";
# 4. Re-build js/scss
docker exec php-fpm bash -c "cd /vhost; npm install; npm run build";
# ...
# N. Recreate trigger
test ! -f $TRIGGER && touch $TRIGGER;
done;