未验证 提交 70977f0d 编写于 作者: R runzexia

return nil

Signed-off-by: Nrunzexia <runzexia@yunify.com>
上级 e94ef57d
......@@ -49,10 +49,12 @@ func Client() *gojenkins.Jenkins {
jenkins, err := jenkins.Init()
if err != nil {
glog.Errorf("failed to connect jenkins, %+v", err)
return nil
}
globalRole, err := jenkins.GetGlobalRole(JenkinsAllUserRoleName)
if err != nil {
glog.Errorf("failed to get jenkins role, %+v", err)
return nil
}
if globalRole == nil {
_, err := jenkins.AddGlobalRole(JenkinsAllUserRoleName, gojenkins.GlobalPermissionIds{
......@@ -60,6 +62,7 @@ func Client() *gojenkins.Jenkins {
}, true)
if err != nil {
glog.Errorf("failed to create jenkins global role, %+v", err)
return nil
}
}
_, err = jenkins.AddProjectRole(JenkinsAllUserRoleName, "\\n\\s*\\r", gojenkins.ProjectPermissionIds{
......@@ -67,6 +70,7 @@ func Client() *gojenkins.Jenkins {
}, true)
if err != nil {
glog.Errorf("failed to create jenkins project role, %+v", err)
return nil
}
jenkinsClient = jenkins
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册