ehsan-dashboards/dashboards/get_backend_env.py

13 lines
476 B
Python

import requests
import urllib.parse
gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m'
headers = {'PRIVATE-TOKEN': gitlab_pat}
for p in ['.env.example', '.env', 'docker-compose.yml', 'captain-definition']:
file_path = urllib.parse.quote(p, safe='')
url = f'https://gitlab.ekeepa.co/api/v4/projects/10/repository/files/{file_path}/raw?ref=main'
r = requests.get(url, headers=headers)
if r.status_code == 200:
print(f"=== {p} ===")
print(r.text[:1000])