Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
2f02aa55
K
kubesphere
项目概览
水淹萌龙
/
kubesphere
与 Fork 源项目一致
Fork自
KubeSphere / kubesphere
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
未验证
提交
2f02aa55
编写于
6月 04, 2019
作者:
S
soulseen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format log
Signed-off-by:
N
soulseen
<
sunzhu@yunify.com
>
上级
7e1774eb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
43 deletion
+43
-43
pkg/apiserver/devops/devops.go
pkg/apiserver/devops/devops.go
+1
-1
pkg/models/devops/devops.go
pkg/models/devops/devops.go
+42
-42
未找到文件。
pkg/apiserver/devops/devops.go
浏览文件 @
2f02aa55
...
...
@@ -26,7 +26,7 @@ import (
"strings"
)
const
jenkinsHeaderPre
=
"X-"
const
jenkinsHeaderPre
=
"X-"
func
GetPipeline
(
req
*
restful
.
Request
,
resp
*
restful
.
Response
)
{
projectName
:=
req
.
PathParameter
(
"projectName"
)
...
...
pkg/models/devops/devops.go
浏览文件 @
2f02aa55
...
...
@@ -70,9 +70,9 @@ func SearchPipelines(req *http.Request) ([]byte, error) {
func
SearchPipelineRuns
(
projectName
,
pipelineName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
SearchPipelineRunUrl
,
projectName
,
pipelineName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
+
req
.
URL
.
RawQuery
,
req
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
+
req
.
URL
.
RawQuery
,
req
)
if
err
!=
nil
{
log
.
Error
(
err
)
return
nil
,
err
...
...
@@ -83,7 +83,7 @@ func SearchPipelineRuns(projectName, pipelineName string, req *http.Request) ([]
func
GetBranchPipelineRun
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetPipeBranchRunUrl
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -96,7 +96,7 @@ func GetBranchPipelineRun(projectName, pipelineName, branchName, runId string, r
func
GetPipelineRunNodesbyBranch
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchPipeRunNodesUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -109,7 +109,7 @@ func GetPipelineRunNodesbyBranch(projectName, pipelineName, branchName, runId st
func
GetBranchStepLog
(
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
,
stepId
string
,
req
*
http
.
Request
)
([]
byte
,
http
.
Header
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchStepLogUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
,
stepId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
header
,
err
:=
jenkinsClient
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -122,7 +122,7 @@ func GetBranchStepLog(projectName, pipelineName, branchName, runId, nodeId, step
func
GetStepLog
(
projectName
,
pipelineName
,
runId
,
nodeId
,
stepId
string
,
req
*
http
.
Request
)
([]
byte
,
http
.
Header
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetStepLogUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
,
nodeId
,
stepId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
header
,
err
:=
jenkinsClient
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -136,7 +136,7 @@ func GetStepLog(projectName, pipelineName, runId, nodeId, stepId string, req *ht
func
Validate
(
scmId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
ValidateUrl
,
scmId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -149,7 +149,7 @@ func Validate(scmId string, req *http.Request) ([]byte, error) {
func
GetSCMOrg
(
scmId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetSCMOrgUrl
+
req
.
URL
.
RawQuery
,
scmId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -162,7 +162,7 @@ func GetSCMOrg(scmId string, req *http.Request) ([]byte, error) {
func
GetOrgRepo
(
scmId
,
organizationId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetOrgRepoUrl
+
req
.
URL
.
RawQuery
,
scmId
,
organizationId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -175,7 +175,7 @@ func GetOrgRepo(scmId, organizationId string, req *http.Request) ([]byte, error)
func
StopBranchPipeline
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
StopBranchPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -188,7 +188,7 @@ func StopBranchPipeline(projectName, pipelineName, branchName, runId string, req
func
StopPipeline
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
StopPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -201,7 +201,7 @@ func StopPipeline(projectName, pipelineName, runId string, req *http.Request) ([
func
ReplayBranchPipeline
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
ReplayBranchPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -214,7 +214,7 @@ func ReplayBranchPipeline(projectName, pipelineName, branchName, runId string, r
func
ReplayPipeline
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
ReplayPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -227,7 +227,7 @@ func ReplayPipeline(projectName, pipelineName, runId string, req *http.Request)
func
GetBranchRunLog
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchRunLogUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -240,7 +240,7 @@ func GetBranchRunLog(projectName, pipelineName, branchName, runId string, req *h
func
GetRunLog
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetRunLogUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -253,7 +253,7 @@ func GetRunLog(projectName, pipelineName, runId string, req *http.Request) ([]by
func
GetBranchArtifacts
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchArtifactsUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -266,7 +266,7 @@ func GetBranchArtifacts(projectName, pipelineName, branchName, runId string, req
func
GetArtifacts
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetArtifactsUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -279,9 +279,9 @@ func GetArtifacts(projectName, pipelineName, runId string, req *http.Request) ([
func
GetPipeBranch
(
projectName
,
pipelineName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetPipeBranchUrl
,
projectName
,
pipelineName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
+
req
.
URL
.
RawQuery
,
req
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
+
req
.
URL
.
RawQuery
,
req
)
if
err
!=
nil
{
log
.
Error
(
err
)
return
nil
,
err
...
...
@@ -292,7 +292,7 @@ func GetPipeBranch(projectName, pipelineName string, req *http.Request) ([]byte,
func
CheckBranchPipeline
(
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
,
stepId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
CheckBranchPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
,
stepId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -305,7 +305,7 @@ func CheckBranchPipeline(projectName, pipelineName, branchName, runId, nodeId, s
func
CheckPipeline
(
projectName
,
pipelineName
,
runId
,
nodeId
,
stepId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
CheckPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
,
nodeId
,
stepId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -318,7 +318,7 @@ func CheckPipeline(projectName, pipelineName, runId, nodeId, stepId string, req
func
GetConsoleLog
(
projectName
,
pipelineName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetConsoleLogUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -331,7 +331,7 @@ func GetConsoleLog(projectName, pipelineName string, req *http.Request) ([]byte,
func
ScanBranch
(
projectName
,
pipelineName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
ScanBranchUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
resBody
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -344,7 +344,7 @@ func ScanBranch(projectName, pipelineName string, req *http.Request) ([]byte, er
func
RunBranchPipeline
(
projectName
,
pipelineName
,
branchName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
RunBranchPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -357,7 +357,7 @@ func RunBranchPipeline(projectName, pipelineName, branchName string, req *http.R
func
RunPipeline
(
projectName
,
pipelineName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
RunPipelineUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -370,7 +370,7 @@ func RunPipeline(projectName, pipelineName string, req *http.Request) ([]byte, e
func
GetBranchStepsStatus
(
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchStepsStatusUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -383,7 +383,7 @@ func GetBranchStepsStatus(projectName, pipelineName, branchName, runId, nodeId s
func
GetStepsStatus
(
projectName
,
pipelineName
,
runId
,
nodeId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetStepsStatusUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
,
nodeId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -396,7 +396,7 @@ func GetStepsStatus(projectName, pipelineName, runId, nodeId string, req *http.R
func
GetCrumb
(
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetCrumbUrl
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -409,7 +409,7 @@ func GetCrumb(req *http.Request) ([]byte, error) {
func
CheckScriptCompile
(
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
jenkins
.
Server
+
CheckScriptCompileUrl
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
req
.
SetBasicAuth
(
jenkins
.
Requester
.
BasicAuth
.
Username
,
jenkins
.
Requester
.
BasicAuth
.
Password
)
resBody
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
...
...
@@ -455,7 +455,7 @@ func CheckCron(req *http.Request) (*CheckCronRes, error) {
func
GetPipelineRun
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetPipelineRunUrl
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -468,7 +468,7 @@ func GetPipelineRun(projectName, pipelineName, runId string, req *http.Request)
func
GetBranchPipeline
(
projectName
,
pipelineName
,
branchName
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchPipeUrl
,
projectName
,
pipelineName
,
branchName
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -481,7 +481,7 @@ func GetBranchPipeline(projectName, pipelineName, branchName string, req *http.R
func
GetPipelineRunNodes
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetPipeRunNodesUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -494,7 +494,7 @@ func GetPipelineRunNodes(projectName, pipelineName, runId string, req *http.Requ
func
GetBranchNodeSteps
(
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchNodeStepsUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
,
nodeId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -507,7 +507,7 @@ func GetBranchNodeSteps(projectName, pipelineName, branchName, runId, nodeId str
func
GetNodeSteps
(
projectName
,
pipelineName
,
runId
,
nodeId
string
,
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetNodeStepsUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
,
nodeId
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -520,7 +520,7 @@ func GetNodeSteps(projectName, pipelineName, runId, nodeId string, req *http.Req
func
ToJenkinsfile
(
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
ToJenkinsfileUrl
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -533,7 +533,7 @@ func ToJenkinsfile(req *http.Request) ([]byte, error) {
func
ToJson
(
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
ToJsonUrl
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -545,8 +545,8 @@ func ToJson(req *http.Request) ([]byte, error) {
}
func
GetNotifyCommit
(
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprint
(
jenkins
.
Server
+
GetNotifyCommitUrl
+
req
.
URL
.
RawQuery
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
baseUrl
:=
fmt
.
Sprint
(
jenkins
.
Server
,
GetNotifyCommitUrl
,
req
.
URL
.
RawQuery
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
req
.
Method
=
"GET"
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
...
...
@@ -559,8 +559,8 @@ func GetNotifyCommit(req *http.Request) ([]byte, error) {
}
func
GithubWebhook
(
req
*
http
.
Request
)
([]
byte
,
error
)
{
baseUrl
:=
fmt
.
Sprint
f
(
jenkins
.
Server
+
GithubWebhookUrl
+
req
.
URL
.
RawQuery
)
log
.
Info
f
(
"Jenkins-url: "
+
baseUrl
)
baseUrl
:=
fmt
.
Sprint
(
jenkins
.
Server
,
GithubWebhookUrl
,
req
.
URL
.
RawQuery
)
log
.
Info
(
"Jenkins-url: "
+
baseUrl
)
res
,
err
:=
sendJenkinsRequest
(
baseUrl
,
req
)
if
err
!=
nil
{
...
...
@@ -573,7 +573,7 @@ func GithubWebhook(req *http.Request) ([]byte, error) {
func
GetBranchNodesDetail
(
projectName
,
pipelineName
,
branchName
,
runId
string
,
req
*
http
.
Request
)
([]
NodesDetail
,
error
)
{
getNodesUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetBranchPipeRunNodesUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
branchName
,
runId
)
log
.
Info
f
(
"getNodesUrl: "
+
getNodesUrl
)
log
.
Info
(
"getNodesUrl: "
+
getNodesUrl
)
var
wg
sync
.
WaitGroup
var
nodesDetails
[]
NodesDetail
stepChan
:=
make
(
chan
*
NodesStepsIndex
,
channelMaxCapacity
)
...
...
@@ -620,7 +620,7 @@ func GetBranchNodesDetail(projectName, pipelineName, branchName, runId string, r
func
GetNodesDetail
(
projectName
,
pipelineName
,
runId
string
,
req
*
http
.
Request
)
([]
NodesDetail
,
error
)
{
getNodesUrl
:=
fmt
.
Sprintf
(
jenkins
.
Server
+
GetPipeRunNodesUrl
+
req
.
URL
.
RawQuery
,
projectName
,
pipelineName
,
runId
)
log
.
Info
f
(
"getNodesUrl: "
+
getNodesUrl
)
log
.
Info
(
"getNodesUrl: "
+
getNodesUrl
)
var
wg
sync
.
WaitGroup
var
nodesDetails
[]
NodesDetail
stepChan
:=
make
(
chan
*
NodesStepsIndex
,
channelMaxCapacity
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录