mirror of
https://github.com/cooperspencer/gickup
synced 2024-11-08 12:09:18 +01:00
added option to mirror to specific org or user in gitea and gogs
This commit is contained in:
parent
041a5a88b7
commit
99ad5cc1b6
@ -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
|
||||
}
|
||||
|
10
gogs/gogs.go
10
gogs/gogs.go
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user