diff --git a/buildtrigger/gitlabhandler.py b/buildtrigger/gitlabhandler.py index 8c1dba555..b2f0bbf28 100644 --- a/buildtrigger/gitlabhandler.py +++ b/buildtrigger/gitlabhandler.py @@ -318,7 +318,11 @@ class GitLabBuildTrigger(BuildTriggerHandler): return None def get_repository_url(self): - return 'https://gitlab.com/%s' % self.config['build_source'] + # Get the host and remove a trailing slash. + host = app.config.get('GITLAB_TRIGGER_CONFIG', {}).get('GITLAB_ENDPOINT', '') + host = host[0:-1] if host[-1] == '/' else host + + return '%s/%s' % (host, self.config['build_source']) @_catch_timeouts def lookup_user(self, email):