Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang committed Sep 11, 2023
1 parent a275756 commit 81312c8
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://root:[email protected]:5432/canyon
#mongodb url
MONGODB_URL=mongodb://t_flttsworkstruct:HW3cp57rCtgk9DKUmFEz@flttsworkstruct01.mongo.db.fat.qa.nt.ctripcorp.com:55111/flttsworkstructdb
# Gitlab Auth Config
GITLAB_URL="http://git.dev.sh.ctripcorp.com"
GITLAB_TOKEN="6bb2887ea5bc21df691ab73f877b056593a798471f1a161e9b2682ed885dc84f"
GITLAB_CLIENT_ID="7fa15c07f39bf9a394e61a7fec497d2ff4b51545bcc84272fbbc7bac82dc4999"
GITLAB_CLIENT_SECRET="ed033561bb04e587fbcf738d38efa3e088e41ab07fd814787669d4f38ff062bb"

# Backend URLs
VITE_BACKEND_API_URL=http://10.5.153.1:3170
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ dist-ssr

pnpm-lock.yaml

.env
#.env
7 changes: 7 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path')
const packageConfig = require(path.resolve(__dirname, './package.json'))

module.exports = {
AppID: packageConfig.AppID,
Env: 'fws',
}
1 change: 1 addition & 0 deletions eslint-report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
},
"keywords": [],
"author": "",
"license": "ISC"
}
"license": "ISC",
"AppId": "100034535"
}
2 changes: 2 additions & 0 deletions scripts/dump.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
node "%~dp0..\node_modules\@ctrip\node-vampire-heapdump\scripts\dumpApp.js" %*
3 changes: 3 additions & 0 deletions scripts/dump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
scriptsDir=$(dirname $BASH_SOURCE)
node ${scriptsDir%%/}/"../node_modules/@ctrip/node-vampire-heapdump/scripts/dumpApp.js" $*
3 changes: 3 additions & 0 deletions scripts/processCount.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
scriptsDir=$(dirname $BASH_SOURCE)
cat ${scriptsDir%%/}/"../node_modules/@ctrip/node-vampire-heapdump/.state.json"
3 changes: 3 additions & 0 deletions scripts/shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pm2 delete all

exit 0
39 changes: 39 additions & 0 deletions scripts/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

appid=${PAAS_APP_APPID:-100034535}
appname=nodeapp-$appid


# 不同的环境因为机器配置不一样,使用不同的实例数
case "$env" in
"FWS"|"FAT"|"LPT")
instance=1
;;
"UAT")
instance=5
;;
*)
instance=10
;;
esac

pm2 delete all

if [ -d /opt/nodeapp ]; then
# docker
cd /opt/nodeapp
else
# vm
cd "$(dirname $BASH_SOURCE)/../current/"
fi


NODE_ENV=production pm2 start packages/app-backend/dist/main.js \
-i $instance \
--name $appname \
--merge-logs \
--log-date-format "YYYY-MM-DD HH:mm:ss.SSS" \
--log "/opt/logs/$appid/outerr.log" \
--output "/opt/logs/$appid/out.log" \
--error "/opt/logs/$appid/err.log"
exit 0

0 comments on commit 81312c8

Please sign in to comment.