未验证 提交 b31cfbfa 编写于 作者: C colynn.liu 提交者: GitHub

Merge pull request #185 from sampsonye/fix-gitee

fix: gitee private repo can not clone in jenkins
......@@ -142,7 +142,8 @@ func (config *Config) Struct(sc string, settingType string) (interface{}, error)
err := json.Unmarshal([]byte(sc), scmConf)
return scmConf, err
case "gitea", "gitee", "github":
scmConf := &ScmBaseConfig{}
scmConf := &ScmAuthConf{}
scmConf.User = "oauth2"
err := json.Unmarshal([]byte(sc), scmConf)
return scmConf, err
default:
......@@ -197,7 +198,7 @@ func (pm *SettingManager) GetSCMIntegrateSettinByID(id int64) (*ScmIntegrateSett
func getScmConf(scmType string, config interface{}) ScmAuthConf {
scmCONF := ScmAuthConf{}
switch strings.ToLower(scmType) {
case constant.SCMGitlab:
case constant.SCMGitlab, constant.SCMGitea, constant.SCMGitee, constant.SCMGithub:
if conf, ok := config.(*ScmAuthConf); ok {
scmCONF.URL = conf.URL
scmCONF.User = conf.User
......@@ -205,13 +206,6 @@ func getScmConf(scmType string, config interface{}) ScmAuthConf {
} else {
log.Log.Error("parse type: %s conf error", constant.SCMGitlab)
}
case constant.SCMGitea, constant.SCMGitee, constant.SCMGithub:
if conf, ok := config.(*ScmBaseConfig); ok {
scmCONF.URL = conf.URL
scmCONF.Token = conf.Token
} else {
log.Log.Error("parse type: %s conf error", "scmbase conf")
}
}
return scmCONF
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册