Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
d092d238
Commit
d092d238
authored
Apr 08, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 编写部署到测试环境的相关脚本
parent
7c1cf367
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
deploytest.js
deploy/deploytest.js
+0
-0
util.js
deploy/util.js
+19
-0
config.ts
src/config.ts
+1
-0
No files found.
deploy/deploytest.js
View file @
d092d238
This diff is collapsed.
Click to expand it.
deploy/util.js
0 → 100644
View file @
d092d238
import
{
execSync
}
from
'node:child_process'
import
{
createHash
}
from
'node:crypto'
// 获取当前分支名 去掉空格 斜杠 换行 等特殊字符
export
const
getCurrentBranchName
=
()
=>
{
const
branchName
=
execSync
(
'git branch --show-current'
,
{
encoding
:
'utf-8'
,
})
.
trim
()
.
replaceAll
(
' '
,
'_'
)
.
replaceAll
(
'/'
,
'_'
)
.
replaceAll
(
'
\
n'
,
'_'
)
return
branchName
}
// 根据分支名创建一个唯一的服务器文件夹名字
export
const
getDeploySlug
=
(
branchName
)
=>
{
return
`branch-
${
createHash
(
'md5'
).
update
(
branchName
).
digest
(
'hex'
).
slice
(
0
,
8
)}
`
}
src/config.ts
View file @
d092d238
...
...
@@ -17,6 +17,7 @@ export const app_config: { [key: string]: IConfig } = {
// 测试环境 暂时无测试环境部署
test
:
{
// baseUrl: 'http://culture.yswg.com.cn:8089', // 线上测试机
baseUrl
:
'http://192.168.2.55:8089'
,
// 首拥本地
loginType
:
1
,
wxRedirect
:
''
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment