Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master wand by Vlad Glagolev (c1ea2c0c8b1c63893ccc8110bf63ab87c2de0735)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master wand by Vlad Glagolev (c1ea2c0c8b1c63893ccc8110bf63ab87c2de0735)
  • Date: Mon, 29 Aug 2022 03:30:22 +0000

GIT changes to master wand by Vlad Glagolev <stealth AT sourcemage.org>:

remirror/remirror | 41
++++++++++++++++++++++++++++++++++++++---
remirror/remirror.config.yaml | 5 +++++
2 files changed, 43 insertions(+), 3 deletions(-)

New commits:
commit c1ea2c0c8b1c63893ccc8110bf63ab87c2de0735
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

Add Codeberg support

diff --git a/remirror/remirror b/remirror/remirror
index 67ec4a7..30a253d 100755
--- a/remirror/remirror
+++ b/remirror/remirror
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
-# (c) 2017-2021, Vlad Glagolev <stealth AT sourcemage.org>
+# (c) 2017-2022, Vlad Glagolev <stealth AT sourcemage.org>

import argparse
import os
@@ -37,7 +37,7 @@ except ImportError:
HAS_REQUESTS = False


-__version__ = "0.0.6" # major.minor.revision
+__version__ = "0.0.7" # major.minor.revision


# ~/.sourcemage/mirror.yaml
@@ -52,7 +52,8 @@ _CONFIG_FORMAT = {
PROVIDERS = {
'github': 'ProviderGitHub',
'bitbucket': 'ProviderBitbucket',
- 'sourcehut': 'ProviderSourceHut'
+ 'sourcehut': 'ProviderSourceHut',
+ 'codeberg': 'ProviderCodeberg'
}


@@ -363,6 +364,40 @@ class ProviderSourceHut(Provider):
raise requests.HTTPError(404)


+class ProviderGitea(Provider):
+ api_url = None
+ git_host = None
+
+ def __init__(self, conf, errcode):
+ super(ProviderGitea, self).__init__(conf, errcode)
+
+ self.auth = {'headers': {"Authorization": "token %s" %
self.conf['token']}}
+ self.group = self.conf.get('organization')
+ self.default_branch = "master"
+
+ def sanity_check(self, repo):
+ repo_ok = "/repos/{0}/{1}".format(self.group, repo.name)
+
+ req = self.http_call(repo_ok)
+
+ if req.status_code == 404:
+ repo_mk = "/orgs/{0}/repos".format(self.group)
+
+ payload = {'name': repo.name,
+ 'default_branch': self.default_branch}
+
+ req = self.http_call(repo_mk, payload)
+
+ req.raise_for_status()
+ else:
+ req.raise_for_status()
+
+
+class ProviderCodeberg(ProviderGitea):
+ api_url = "https://codeberg.org/api/v1/";
+ git_host = "git AT codeberg.org"
+
+
def mirror(conf):
queue = Queue()
errcode = Value('i', 0)
diff --git a/remirror/remirror.config.yaml b/remirror/remirror.config.yaml
index 870a348..9407dca 100644
--- a/remirror/remirror.config.yaml
+++ b/remirror/remirror.config.yaml
@@ -62,3 +62,8 @@ mirrors:
username: magesync
token: secret
organization: sourcemage
+
+ - name: codeberg
+ username: magesync
+ token: secret
+ organization: sourcemage



  • [SM-Commit] GIT changes to master wand by Vlad Glagolev (c1ea2c0c8b1c63893ccc8110bf63ab87c2de0735), Vlad Glagolev, 08/28/2022

Archive powered by MHonArc 2.6.24.

Top of Page