mirror of
https://github.com/cooperspencer/gickup.git
synced 2026-10-19 16:16:46 +00:00
added option to mirror to specific org or user in gitea and gogs
This commit is contained in:
@@ -141,10 +141,12 @@ destination:
|
||||
gitea:
|
||||
- token: some-token
|
||||
# token_file: token.txt # alternatively, specify token in a file
|
||||
user: some-nome # can be a user or an organization, it must exist on the system
|
||||
url: http(s)://url-to-gitea
|
||||
gogs:
|
||||
- token: some-token
|
||||
# token_file: token.txt # alternatively, specify token in a file
|
||||
user: some-nome # can be a user or an organization, it must exist on the system
|
||||
url: http(s)://url-to-gogs
|
||||
gitlab:
|
||||
- token: some-token
|
||||
|
||||
@@ -32,6 +32,16 @@ func Backup(r types.Repo, d types.GenRepo, dry bool) {
|
||||
Msg(err.Error())
|
||||
}
|
||||
|
||||
if d.User != "" {
|
||||
user, _, err = giteaclient.GetUserInfo(d.User)
|
||||
if err != nil {
|
||||
log.Fatal().
|
||||
Str("stage", "gitea").
|
||||
Str("url", d.URL).
|
||||
Msg(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if dry {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -23,6 +23,16 @@ func Backup(r types.Repo, d types.GenRepo, dry bool) {
|
||||
Msg(err.Error())
|
||||
}
|
||||
|
||||
if d.User != "" {
|
||||
user, err = gogsclient.GetUserInfo(d.User)
|
||||
if err != nil {
|
||||
log.Fatal().
|
||||
Str("stage", "gogs").
|
||||
Str("url", d.URL).
|
||||
Msgf("couldn't find %s", d.User)
|
||||
}
|
||||
}
|
||||
|
||||
if dry {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user