This commit is contained in:
aozhiwei 2023-11-17 21:36:43 +08:00
parent 3bf26d5dba
commit 6d78a9f23a
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,16 @@
source ./common.sh
cd ${SOURCE_PATH}
${PRE_COMPILE_CMD}
cmake ${COMPILE_FLAGS}
make clean
make
cp ../bin/${SRC_EXE_NAME} ../../../../bin/${PROJECT_NAME}
cd ../../../../
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}

View File

@ -0,0 +1,13 @@
const appName = process.argv[5];
const n = process.argv[6];
const i = process.argv[7];
const execName = process.argv[8];
module.exports = {
apps: [{
name: appName,
args: `-n${n} -i${i}`,
script: './' + execName,
cwd: 'bin'
}]
};

View File

View File

@ -0,0 +1,16 @@
#!/bin/bash
source ./common.sh
ps -ef|grep ${PROJECT_NAME} > bin/ps.log
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'