From 6cbd5ca369eda9ea55145f6b2ddebbbbb585a0db Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 19 Sep 2018 16:57:07 +0200 Subject: [PATCH] Improve asset building process After running ./gulp for every project, we delete node_modules. --- deploy/2docker.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/deploy/2docker.sh b/deploy/2docker.sh index 487c92b..3ba3fd1 100755 --- a/deploy/2docker.sh +++ b/deploy/2docker.sh @@ -105,11 +105,23 @@ if [ ! -e $GULP -o gulpfile.js -nt $GULP ]; then touch $GULP # installer doesn't always touch this after a build, so we do. fi -pushd $DEPLOYDIR/pillar; ./gulp --production; popd; -pushd $DEPLOYDIR/attract; ./gulp --production; popd; -pushd $DEPLOYDIR/flamenco; ./gulp --production; popd; -pushd $DEPLOYDIR/pillar-svnman; ./gulp --production; popd; -pushd $DEPLOYDIR/blender-cloud; ./gulp --production; popd; + + +# List of projects +declare -a proj=("pillar" "attract" "flamenco" "pillar-svnman" "blender-cloud") + +# Run ./gulp for every project +for i in "${proj[@]}" +do + pushd $DEPLOYDIR/$i; ./gulp --production; popd; +done + +# Remove node_modules (only after all projects with interdependencies have been built) +for i in "${proj[@]}" +do + pushd $DEPLOYDIR/$i; rm -r node_modules; popd; +done + echo echo "==================================================================="