#!/bin/bash module_path="/data/publish/node_packages/card_info_svr" if [ ! -d $module_path ]; then mkdir -p $module_path fi module_sub_path=$module_path"/node_modules" if [ ! -d $module_sub_path ]; then npm install --prefer-offline --loglevel info --unsafe-perm=true --allow-root >> boundle.log echo 'copy node_modules to /data/publish/node_packages' >> boundle.log cp -r node_modules $module_sub_path else cp -r $module_sub_path ./node_modules fi #npm install --prefer-offline --loglevel info --unsafe-perm=true --allow-root >> boundle.log #echo 'copy node_modules to /data/publish/node_packages' >> boundle.log #rm -rf $module_sub_path #cp -r node_modules $module_sub_path ./node_modules/.bin/tsc >> boundle.log mkdir target tag_name=`git status |grep '# On branch '|sed 's/# On branch //g'` dir_name=`basename $PWD` package_name=${dir_name}.tar.gz #echo $tag_name #echo $dir_name #echo $package_name tar -zcf ./target/${package_name} --exclude=.git --exclude=target ./ echo 'all done' 2>&1 >> boundle.log