gitlab-test/app/languages.py
Tobias Trabelsi 887ed5c0ef
All checks were successful
continuous-integration/drone/push Build is passing
sonarqube happy as well
2022-05-22 00:26:38 +02:00

25 lines
586 B
Python

#!/usr/bin/env python3
import gitlab
import os
def get_project(client, project_name):
return client.projects.get(project_name)
def get_language(project):
return list(project.languages().items())
def helm_set(lang):
ret = ''
for i in range(len(lang)):
ret += f"--set global.language[{i}]={lang[i][0]}"
return ret
if __name__ == '__main__':
with gitlab.Gitlab(url=os.environ['GITLAB_URL'], private_token=os.environ['GITLAB_TOKEN'], user_agent='my-package/1.0.0') as gl:
print(helm_set(get_language(get_project(gl, 'root/test'))), end=" ")