[sysadmin-bin] Allow specifying different GitLab namespaces



commit b3833b3406ac2f3804b8886e1445a49a309d61fe
Author: Andrea Veri <averi redhat com>
Date:   Tue Sep 4 15:08:36 2018 +0200

    Allow specifying different GitLab namespaces

 gnomeweb/update_sites.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gnomeweb/update_sites.py b/gnomeweb/update_sites.py
index 33d471b..7821dd7 100755
--- a/gnomeweb/update_sites.py
+++ b/gnomeweb/update_sites.py
@@ -23,7 +23,7 @@ from git import *
 
 timestamp_dir = "/usr/local/www/gnomeweb/timestamps"
 hookscripts_dir = "/usr/local/www/gnomeweb/hooks"
-checkout_url = "https://gitlab.gnome.org/Infrastructure/%(module)s.git"
+checkout_url = 'https://gitlab.gnome.org/%(gitlab_namespace)s/%(module)s.git'
 checkout_basedir = "/var/cache/gnomeweb/git" # default base directory for checkouts
 log_dir = "/usr/local/www/gnomeweb/logs"
 re_branch_versioned = r'^gnome-([0-9]+)-([0-9]+)$'
@@ -96,7 +96,13 @@ def update_modules(configfile, configdir, verbose):
             check_branches = False
 
         checkfile = module
-        url = checkout_url % { 'module' : module }
+
+        if cfg.has_option(module, 'gitlab_namespace'):
+            gitlab_namespace = cfg.get(module, 'gitlab_namespace')
+        else:
+            gitlab_namespace = 'Infrastructure'
+
+        url = checkout_url % { 'module' : module, 'gitlab_namespace': gitlab_namespace }
 
         if check_branches:
             lock = try_lock(checkfile, verbose)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]