Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qahome-diamond
Commits
8f78c6fb
Commit
8f78c6fb
authored
Jun 10, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增一键部署master功能
parent
cbc64667
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
3 deletions
+57
-3
dev.env.js
config/dev.env.js
+4
-3
prod.env.js
config/prod.env.js
+1
-0
holmes.js
src/api/holmes.js
+9
-0
requestHolmes.js
src/utils/requestHolmes.js
+23
-0
envDetail.vue
src/views/docker/envDetail.vue
+20
-0
No files found.
config/dev.env.js
View file @
8f78c6fb
module
.
exports
=
{
NODE_ENV
:
'
"development"
'
,
ENV_CONFIG
:
'
"dev"
'
,
QA_API
:
'
"http://127.0.0.1:3003"
'
,
//
QA_API: '"http://qaapi.liangkebang.com"',
//
QA_API: '"http://127.0.0.1:3003"',
QA_API
:
'
"http://qaapi.liangkebang.com"
'
,
TESTDATA_API
:
'
"http://172.30.220.22:3333"
'
,
PIPELINE_API
:
'
"http://pipes.liangkebang.com"
'
PIPELINE_API
:
'
"http://pipes.liangkebang.com"
'
,
HOLMES_API
:
'
"//localhost:8084"
'
}
config/prod.env.js
View file @
8f78c6fb
...
...
@@ -6,4 +6,5 @@ module.exports = {
TESTDATA_API
:
'
"//testdata.liangkebang.com"
'
,
PIPELINE_API
:
'
"//pipes.liangkebang.com"
'
,
PIPELINE_API_JAVA
:
'
"//pipes.liangkebang.com"
'
,
HOLMES_API
:
'
"//holmes-yxm.liangkebang.net"
'
,
}
src/api/holmes.js
0 → 100644
View file @
8f78c6fb
import
request
from
'
@/utils/requestHolmes
'
export
function
buildJenkinsJob
(
paramsInfo
)
{
return
request
({
url
:
'
/jenkins/build
'
,
method
:
'
get
'
,
params
:
paramsInfo
})
}
src/utils/requestHolmes.js
0 → 100644
View file @
8f78c6fb
import
axios
from
'
axios
'
const
service
=
axios
.
create
(
{
baseURL
:
process
.
env
.
HOLMES_API
,
timeout
:
500000
}
)
// request interceptor
service
.
interceptors
.
request
.
use
(
)
// response interceptor
service
.
interceptors
.
response
.
use
(
response
=>
response
,
error
=>
{
console
.
log
(
'
error
'
+
error
)
// for debug
return
Promise
.
reject
(
error
)
}
)
export
default
service
src/views/docker/envDetail.vue
View file @
8f78c6fb
...
...
@@ -160,6 +160,7 @@
<svg-icon
icon-class=
"service"
/>
{{ item._id.toUpperCase() }} 服务
<div
style=
"float: right"
>
<el-button
type=
"primary"
size=
"mini"
round
@
click=
"deployMaster(FormatTabledata[item._id])"
>
一键部署master
</el-button>
<el-button
type=
"warning"
size=
"mini"
round
@
click=
"getRepository(item._id)"
>
新增服务
</el-button>
<el-button
type=
"success"
size=
"mini"
round
@
click=
"refresh"
>
刷新状态
</el-button>
<el-button
type=
"danger"
size=
"mini"
round
@
click=
"restartAll(FormatTabledata[item._id])"
>
重置所有服务
</el-button>
...
...
@@ -456,6 +457,7 @@ import JsonEditor from '@/components/JsonEditor'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
import
{
getHostName
}
from
'
@/api/proconfig
'
import
{
getNotify
}
from
'
@/api/notify
'
import
{
buildJenkinsJob
}
from
'
@/api/holmes
'
export
default
{
components
:
{
JsonEditor
},
directives
:
{
permission
},
...
...
@@ -551,12 +553,30 @@ export default {
this
.
getServicelist
()
},
// 重置所有服务
restartAll
(
serviceList
)
{
for
(
var
x
in
serviceList
)
{
this
.
restartService
(
serviceList
[
x
])
}
},
// 一键部署master
deployMaster
(
serviceList
)
{
for
(
var
x
in
serviceList
)
{
buildJenkinsJob
({
type
:
serviceList
[
x
].
labels
.
type
,
project
:
serviceList
[
x
].
serviceName
,
branch
:
'
master
'
,
namespace
:
this
.
namespace
}).
then
((
resp
)
=>
{
this
.
$message
({
type
:
'
success
'
,
message
:
'
服务
'
+
serviceList
[
x
].
serviceName
+
'
部署master分支成功!
'
})
})
}
},
refreshInterval
(
value
)
{
this
.
$store
.
dispatch
(
'
changeSwitch
'
,
value
)
if
(
value
)
{
...
...
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