fixed install-services and split install and compilation

This commit is contained in:
mserranom 2019-07-23 12:56:49 +00:00
parent 7970532241
commit e4df6be87e
2 changed files with 29 additions and 15 deletions

23
bin/compile-services Executable file
View file

@ -0,0 +1,23 @@
#! env bash
set -ex
grep 'name:' config/services.js | \
sed 's/.*name: "\(.*\)",/\1/' | \
while read service
do
pushd $service
echo "Compiling Service $service"
case $service in
web)
make compile_full
;;
chat)
echo "$service doesn't require a compilation"
;;
*)
npm run compile:all
;;
esac
popd
done

21
bin/install-services Normal file → Executable file
View file

@ -1,25 +1,16 @@
#! env bash
[ -z "`type -t nvm`" ] && cat <<EOF
==========================================================
== NVM not installed, you should consider installing it ==
==========================================================
EOF
set -ex
grep 'name:' config/services.js | \
sed 's/.*name: "\(.*\)",/\1/' | \
while read service
do
pushd $service
echo "Installing Service $service"
echo ' installing Node'
type -t nvm && nvm install
type -t nvm && nvm use
echo ' installing Dependencies'
npm install
grunt install
echo "Installing Node from .nvmrc"
nvm install && nvm use
echo "Installing service $service"
npm install --quiet
popd
done