1
This commit is contained in:
parent
5f5c0addac
commit
d21d38ddaf
28
scripts/publish_pm2_golang/boundle.sh
Normal file
28
scripts/publish_pm2_golang/boundle.sh
Normal 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}
|
13
scripts/publish_pm2_golang/ecosystem.config.js
Normal file
13
scripts/publish_pm2_golang/ecosystem.config.js
Normal 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'
|
||||||
|
}]
|
||||||
|
};
|
3
scripts/publish_pm2_golang/reload.sh
Executable file
3
scripts/publish_pm2_golang/reload.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo 'success'
|
16
scripts/publish_pm2_golang/restart.sh
Executable file
16
scripts/publish_pm2_golang/restart.sh
Executable 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'
|
Loading…
x
Reference in New Issue
Block a user