gitlab: refined enterprise gitlab support

This commit is contained in:
Iain Learmonth 2022-08-30 11:52:55 +01:00
parent 63c36dccd2
commit ece9244966
3 changed files with 11 additions and 7 deletions

View file

@ -18,10 +18,12 @@ class BlockBridgeGitlabAutomation(BlockBridgeReachabilityAutomation):
if "GITLAB_URL" in current_app.config:
credentials['url'] = current_app.config['GITLAB_URL']
gitlab = Gitlab(**credentials)
project = gitlab.project.get(current_app.config['GITLAB_BRIDGE_PROJECT'])
project = gitlab.projects.get(current_app.config['GITLAB_BRIDGE_PROJECT'])
for vantage_point in current_app.config['GITHUB_BRIDGE_VANTAGE_POINTS']:
contents = project.get(
filepath=f"recentResult_{vantage_point}",
contents = project.files.get(
file_path=f"recentResult_{vantage_point}",
ref=current_app.config["GITLAB_BRIDGE_BRANCH"]
)
self._lines = contents.decode().splitlines()
# Decode the base64 first, then decode the UTF-8 string
self._lines = contents.decode().decode('utf-8').splitlines()