Commit cf8d10b0 authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Revert to gitlab_token stored in gitlab_config.py

parent 8b08e7ca
Pipeline #4222 passed with stages
in 39 seconds
......@@ -467,19 +467,22 @@ def create_job_request(job_offer, debug):
"""
# Connecting to Gitlab
try:
# TODO: remove GITLAB_TOKEN variable from gitlab_config.py, revoke token and use the line below
# instead of os.gentenv()
# gitlab_private_token = os.environ['GITLAB_PRIVATE_TOKEN']
gitlab_private_token = os.getenv('GITLAB_PRIVATE_TOKEN', GITLAB_TOKEN)
except KeyError:
print("GITLAB_PRIVATE_TOKEN environment variable not set!")
sys.exit(1)
if debug.verbose:
print('[DEBUG] Gitlab connection to {} '.format(GITLAB_URL) +
'with token {}'.format(GITLAB_TOKEN), file=sys.stderr)
'with token {}'.format(gitlab_private_token), file=sys.stderr)
if not debug.offline:
import gitlab
try:
gitlab_private_token = os.environ['GITLAB_PRIVATE_TOKEN']
except KeyError:
print("GITLAB_PRIVATE_TOKEN environment variable not set!")
sys.exit(1)
gl = gitlab.Gitlab(
GITLAB_URL,
private_token=gitlab_private_token,
......
# Gitlab configuration
GITLAB_URL = "https://gitlab.math.unistra.fr"
GITLAB_TOKEN = "gswFMV-Tvtzm1LZJyPgk"
GITLAB_TARGET_ID = 309 # groupe-calcul/website
GITLAB_TARGET_BRANCH = 'develop'
GITLAB_SOURCE_ID = 309 # groupe-calcul/website
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment