Browse Source

fix bug:can not download code

tags/v1.21.12.1
yuyuanshifu 4 years ago
parent
commit
1e179b1541
2 changed files with 6 additions and 1 deletions
  1. +4
    -0
      modules/setting/setting.go
  2. +2
    -1
      routers/repo/cloudbrain.go

+ 4
- 0
modules/setting/setting.go View File

@@ -438,6 +438,8 @@ var (
JobPath string
JobType string
DebugServerHost string
GitUser string
GitPassword string
)

// DateLang transforms standard language locale name to corresponding value in datetime plugin.
@@ -1113,6 +1115,8 @@ func NewContext() {
JobPath = sec.Key("JOB_PATH").MustString("/datasets/minio/data/opendata/jobs/")
DebugServerHost = sec.Key("DEBUG_SERVER_HOST").MustString("http://192.168.202.73")
JobType = sec.Key("JOB_TYPE").MustString("debug_openi")
GitUser = sec.Key("GIT_USER").MustString("opendata")
GitPassword = sec.Key("GIT_PASSWORD").MustString("pa%40123456")
}

func loadInternalToken(sec *ini.Section) string {


+ 2
- 1
routers/repo/cloudbrain.go View File

@@ -260,7 +260,8 @@ func downloadCode(repo *models.Repository, codePath string) error {
return err
}

command := "git clone " + repo.CloneLink().HTTPS + " " + codePath
repoAddr := repo.CloneLink().HTTPS
command := "git clone " + repoAddr[: strings.Index(repoAddr, ":") + 3] + setting.GitUser + ":" + setting.GitPassword + "@" + repoAddr[strings.Index(repoAddr, ":") + 3 :] + " " + codePath
cmd := exec.Command("/bin/bash", "-c", command)
output, err := cmd.Output()
log.Info(string(output))


Loading…
Cancel
Save