[sysadmin-bin] Set a pre-defined user for gitlab



commit f42b4fcdf3f00f711a5b74ceebe02f1291e51a2b
Author: Andrea Veri <averi redhat com>
Date:   Fri Jun 30 12:57:43 2017 +0200

    Set a pre-defined user for gitlab

 git/gnome-post-receive-email |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/git/gnome-post-receive-email b/git/gnome-post-receive-email
index af83ded..a5635d4 100755
--- a/git/gnome-post-receive-email
+++ b/git/gnome-post-receive-email
@@ -112,7 +112,11 @@ class RefChange(object):
         raise NotImplementedError()
 
     def generate_header(self, out, subject, include_revs=True, oldrev=None, newrev=None, cc=None):
-        user = os.environ['USER']
+        if socket.gethostname() in ('gitlab.gnome.org', 'gitlab-test.gnome.org'):
+            user = 'gitlab'
+        else:
+            user = os.environ['USER']
+
         if user_fullname:
             from_address = "%s <%s src gnome org>" % (Header.Header(user_fullname.decode('utf-8')), user)
         else:


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