diff --git a/scripts/publish_nodejs/boundle.sh b/scripts/publish_nodejs/boundle.sh new file mode 100644 index 0000000..17bbff0 --- /dev/null +++ b/scripts/publish_nodejs/boundle.sh @@ -0,0 +1,7 @@ +source ./common.sh + +tag_name=`git status |grep '# On branch '|sed 's/# On branch //g'` +dir_name=`basename $PWD` +package_name=${dir_name}.tar.gz + +tar --exclude=*.git -chzf target/${package_name} bin common.sh reload.sh restart.sh ecosystem.config.js config ${EXT_PKG_FILES} diff --git a/scripts/publish_nodejs/ecosystem.config.js b/scripts/publish_nodejs/ecosystem.config.js index f80752d..fb72ccc 100644 --- a/scripts/publish_nodejs/ecosystem.config.js +++ b/scripts/publish_nodejs/ecosystem.config.js @@ -7,6 +7,7 @@ module.exports = { apps: [{ name: appName, args: `-n${n} -i${i}`, - script: script + script: script, + cwd: 'bin' }] }; diff --git a/scripts/publish_nodejs/reload.sh b/scripts/publish_nodejs/reload.sh new file mode 100644 index 0000000..e69de29 diff --git a/scripts/publish_nodejs/restart.sh b/scripts/publish_nodejs/restart.sh new file mode 100755 index 0000000..8a98873 --- /dev/null +++ b/scripts/publish_nodejs/restart.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +source ./common.sh + +instances=(${1//,/ }) +n=$2 + +for i in ${instances[@]} +do + pm2 delete ecosystem.config.js --only ${PROJECT_NAME}_n${n}_i${i} $n $i ${PROJECT_NAME} + pm2 start ecosystem.config.js --only ${PROJECT_NAME}_n${n}_i${i} $n $i ${PROJECT_NAME} +done + +echo 'success'