增加小程序server管理JOB
This commit is contained in:
commit
09e4c66fa2
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Go template
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
.idea
|
||||
.vscode
|
||||
release
|
||||
logs
|
29
publish_mini_server.sh
Normal file
29
publish_mini_server.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "${PROJECT_PATH}" == "" ]; then
|
||||
echo "PROJECT_PATH IS NOT FOUND"
|
||||
# shellcheck disable=SC2242
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ "${CONFIG_PATH}" == "" ]; then
|
||||
echo "CONFIG_PATH IS NOT FOUND"
|
||||
# shellcheck disable=SC2242
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ "${APP_ID}" == "" ]; then
|
||||
echo "APP_ID IS NOT FOUND"
|
||||
# shellcheck disable=SC2242
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# 切换到项目目录
|
||||
# shellcheck disable=SC2164
|
||||
# shellcheck disable=SC2009
|
||||
cd "${PROJECT_PATH}" && git pull && go build mini-server.go -o "${APP_ID}" && ps aux | grep "${APP_ID}" | grep -v grep | awk '{print $2}' | xargs kill -9
|
||||
|
||||
# 启动服务
|
||||
nohup "${PROJECT_PATH}"/"${APP_ID}" --config_path="${CONFIG_PATH}" &
|
||||
|
||||
echo "${APP_ID}服务启动成功"
|
Loading…
x
Reference in New Issue
Block a user