summaryrefslogtreecommitdiff
path: root/lorry-controller-webapp
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2016-04-18 15:47:16 +0100
committerVLetrmx <richardipsum@fastmail.co.uk>2016-06-17 18:39:29 +0000
commit7587a31568f960d41c62a8486442bd6d9ea42ba0 (patch)
tree9d175fbf3ea2b9b6eaef82d61bc616e17e1fe97a /lorry-controller-webapp
parentf271373b9b93037d9183d777f34d55d1bc2310b7 (diff)
downloadlorry-controller-7587a31568f960d41c62a8486442bd6d9ea42ba0.tar.gz
Add support for mirroring to a GitLab server
Change-Id: I74dc0265fb3c92259101317d655eb55ccb62c119
Diffstat (limited to 'lorry-controller-webapp')
-rwxr-xr-xlorry-controller-webapp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lorry-controller-webapp b/lorry-controller-webapp
index ee573a2..7d4479c 100755
--- a/lorry-controller-webapp
+++ b/lorry-controller-webapp
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (C) 2014 Codethink Limited
+# Copyright (C) 2014-2016 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -131,9 +131,13 @@ class WEBAPP(cliapp.Application):
self.settings.choice(
['git-server-type'],
- ['gitano', 'gerrit'],
+ ['gitano', 'gerrit', 'gitlab'],
'what API the local Git server speaks')
+ self.settings.string(
+ ['gitlab-private-token'],
+ 'private token for GitLab API access')
+
def find_routes(self):
'''Return all classes that are API routes.
@@ -158,6 +162,11 @@ class WEBAPP(cliapp.Application):
def process_args(self, args):
self.settings.require('statedb')
+ if (self.settings['git-server-type'] == 'gitlab' and
+ not self.settings['gitlab-private-token']):
+ logging.error('A private token must be provided to create '
+ 'repositories on a GitLab instance.')
+ self.settings.require('gitlab-private-token')
self.setup_proxy()