Gitea remote support
This commit is contained in:
parent
25820024cd
commit
a490c7e6c7
@ -62,6 +62,7 @@ cache:
|
||||
- [ ] Add GitHub support
|
||||
- [ ] Rename --gitlab flag to --remote
|
||||
- [ ] Add option to select individual remote for `gpm cache load`
|
||||
- [ ] Add flag for clone timeout for large repos
|
||||
- [x] Use multi-gitlab by default in config init
|
||||
- [x] Update docs for multi-gitlab
|
||||
- [x] Remove all references to old keys
|
||||
|
2
internal/cache/projects_git.go
vendored
2
internal/cache/projects_git.go
vendored
@ -8,7 +8,7 @@ import (
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
|
||||
)
|
||||
|
||||
const gitCloneTimeoutSecs = 30
|
||||
const gitCloneTimeoutSecs = 60
|
||||
|
||||
// Will either read in the current repo, preparing a report
|
||||
// on its current state, or will clone the project if it has not
|
||||
|
@ -14,12 +14,6 @@ func (r *GiteaRemote) ReposToProjects(repos []*gitea.Repository) []*projects.Pro
|
||||
pList := make([]*projects.Project, len(repos))
|
||||
for i, repo := range repos {
|
||||
path := strings.Split(repo.FullName, "/")
|
||||
var repoPath []string
|
||||
if len(path) > 1 {
|
||||
repoPath = path[:len(path)-1]
|
||||
} else {
|
||||
repoPath = path
|
||||
}
|
||||
project := &projects.Project{
|
||||
ID: int(repo.ID),
|
||||
Description: repo.Description,
|
||||
@ -28,7 +22,7 @@ func (r *GiteaRemote) ReposToProjects(repos []*gitea.Repository) []*projects.Pro
|
||||
WebURL: repo.HTMLURL,
|
||||
Name: repo.Name,
|
||||
NameWithNamespace: repo.FullName,
|
||||
Path: strings.Join(repoPath, "/"),
|
||||
Path: path[len(path)-1],
|
||||
AvatarURL: repo.AvatarURL,
|
||||
PathWithNamespace: strings.Join(path, "/"),
|
||||
LastActivityAt: repo.Updated,
|
||||
|
@ -2,7 +2,6 @@ package gitearemote
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
|
||||
@ -20,8 +19,6 @@ func (r *GiteaRemote) StreamProjects(pi *load.ProgressInfo, opts *remote.RemoteQ
|
||||
for {
|
||||
repos, resp, err := r.api.ListMyRepos(gitea.ListReposOptions{ListOptions: giteaListOpts})
|
||||
|
||||
fmt.Printf("Gitea PrevPage %d, NextPage %d, Pages %d\n", resp.PrevPage, resp.NextPage, resp.LastPage)
|
||||
|
||||
if err != nil {
|
||||
pi.ErrorChan <- err
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user