added git lfs for mirrors (#204)

* added git lfs for mirrors

* added openssh-client to ubuntu image

* working push on all branches

* fetch after clone and before pull to get all branches

* checkout all branches is not needed

* fix fetch
This commit is contained in:
Andreas Wachter 2024-02-19 08:42:35 +01:00 committed by GitHub
parent 76bcf763aa
commit 8de9d0f16f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 275 additions and 50 deletions

View file

@ -270,7 +270,7 @@ func backup(repos []types.Repo, conf *types.Conf) {
continue
}
err = local.CreateRemotePush(temprepo, d, cloneurl)
err = local.CreateRemotePush(temprepo, d, cloneurl, r.Origin.LFS)
if err != nil {
if err == git.NoErrAlreadyUpToDate {
log.Info().
@ -293,7 +293,6 @@ func backup(repos []types.Repo, conf *types.Conf) {
prometheus.RepoSuccess.WithLabelValues(r.Hoster, r.Name, r.Owner, "github", "https://github.com").Set(float64(status))
prometheus.DestinationBackupsComplete.WithLabelValues("github").Inc()
os.RemoveAll(tempdir)
}
}
}
@ -348,7 +347,7 @@ func backup(repos []types.Repo, conf *types.Conf) {
continue
}
err = local.CreateRemotePush(temprepo, d, cloneurl)
err = local.CreateRemotePush(temprepo, d, cloneurl, r.Origin.LFS)
if err != nil {
if err == git.NoErrAlreadyUpToDate {
log.Info().
@ -426,7 +425,7 @@ func backup(repos []types.Repo, conf *types.Conf) {
continue
}
err = local.CreateRemotePush(temprepo, d, cloneurl)
err = local.CreateRemotePush(temprepo, d, cloneurl, r.Origin.LFS)
if err != nil {
if err == git.NoErrAlreadyUpToDate {
log.Info().