This commit is contained in:
aozhiwei 2022-04-29 23:24:30 +08:00
parent 5f5c0addac
commit d21d38ddaf
4 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,28 @@
source ./common.sh
work_dir=`pwd`
dir_name=`basename $PWD`
if [ -f "custom_init.sh" ]; then
source ./custom_init.sh
fi
reg='\.*D[1-9]$'
if [[ $dir_name =~ $reg ]]
then
touch bin/is_test_env
cd ${SOURCE_DIR}
git pull
git checkout release
cd $work_dir
fi
cd ${SOURCE_PATH}
echo ${COMPILE_CMD}|sh
cp ../bin/${SRC_EXE_NAME} ../../../../bin/${PROJECT_NAME}
cd $work_dir
tag_name=`git status |grep '# On branch '|sed 's/# On branch //g'`
package_name=${dir_name}.tar.gz
tar --exclude=*.git -chzf target/${package_name} bin common.sh reload.sh restart.sh config ecosystem.config.js ${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

@ -0,0 +1,3 @@
#!/bin/bash
echo 'success'

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'