mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
ci: gitlab auth failing hint
This commit is contained in:
parent
d42e3fce04
commit
432c5a783d
18
conftest.py
18
conftest.py
@ -11,8 +11,6 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import gitlab
|
|
||||||
|
|
||||||
if os.path.join(os.path.dirname(__file__), 'tools', 'ci') not in sys.path:
|
if os.path.join(os.path.dirname(__file__), 'tools', 'ci') not in sys.path:
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), 'tools', 'ci'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), 'tools', 'ci'))
|
||||||
|
|
||||||
@ -161,22 +159,8 @@ def app_downloader(pipeline_id: t.Optional[str]) -> t.Optional[AppDownloader]:
|
|||||||
|
|
||||||
logging.info('Downloading build report from the build pipeline %s', pipeline_id)
|
logging.info('Downloading build report from the build pipeline %s', pipeline_id)
|
||||||
test_app_presigned_urls_file = None
|
test_app_presigned_urls_file = None
|
||||||
try:
|
|
||||||
gl = gitlab_api.Gitlab(os.getenv('CI_PROJECT_ID', 'espressif/esp-idf'))
|
|
||||||
except gitlab.exceptions.GitlabAuthenticationError:
|
|
||||||
msg = """To download artifacts from gitlab, please create ~/.python-gitlab.cfg with the following content:
|
|
||||||
|
|
||||||
[global]
|
gl = gitlab_api.Gitlab(os.getenv('CI_PROJECT_ID', 'espressif/esp-idf'))
|
||||||
default = internal
|
|
||||||
ssl_verify = true
|
|
||||||
timeout = 5
|
|
||||||
|
|
||||||
[internal]
|
|
||||||
url = <OUR INTERNAL HTTPS SERVER URL>
|
|
||||||
private_token = <YOUR PERSONAL ACCESS TOKEN>
|
|
||||||
api_version = 4
|
|
||||||
"""
|
|
||||||
raise SystemExit(msg)
|
|
||||||
|
|
||||||
for child_pipeline in gl.project.pipelines.get(pipeline_id, lazy=True).bridges.list(iterator=True):
|
for child_pipeline in gl.project.pipelines.get(pipeline_id, lazy=True).bridges.list(iterator=True):
|
||||||
if child_pipeline.name == 'build_child_pipeline':
|
if child_pipeline.name == 'build_child_pipeline':
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -11,7 +10,12 @@ import tempfile
|
|||||||
import time
|
import time
|
||||||
import zipfile
|
import zipfile
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Any, Callable, Dict, List, Optional, Union
|
from typing import Any
|
||||||
|
from typing import Callable
|
||||||
|
from typing import Dict
|
||||||
|
from typing import List
|
||||||
|
from typing import Optional
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
import gitlab
|
import gitlab
|
||||||
|
|
||||||
@ -80,7 +84,24 @@ class Gitlab(object):
|
|||||||
def _init_gitlab_inst(self, project_id: Optional[int], config_files: Optional[List[str]]) -> None:
|
def _init_gitlab_inst(self, project_id: Optional[int], config_files: Optional[List[str]]) -> None:
|
||||||
gitlab_id = os.getenv('LOCAL_GITLAB_HTTPS_HOST') # if None, will use the default gitlab server
|
gitlab_id = os.getenv('LOCAL_GITLAB_HTTPS_HOST') # if None, will use the default gitlab server
|
||||||
self.gitlab_inst = gitlab.Gitlab.from_config(gitlab_id=gitlab_id, config_files=config_files)
|
self.gitlab_inst = gitlab.Gitlab.from_config(gitlab_id=gitlab_id, config_files=config_files)
|
||||||
self.gitlab_inst.auth()
|
|
||||||
|
try:
|
||||||
|
self.gitlab_inst.auth()
|
||||||
|
except gitlab.exceptions.GitlabAuthenticationError:
|
||||||
|
msg = """To call gitlab apis locally, please create ~/.python-gitlab.cfg with the following content:
|
||||||
|
|
||||||
|
[global]
|
||||||
|
default = internal
|
||||||
|
ssl_verify = true
|
||||||
|
timeout = 5
|
||||||
|
|
||||||
|
[internal]
|
||||||
|
url = <OUR INTERNAL HTTPS SERVER URL>
|
||||||
|
private_token = <YOUR PERSONAL ACCESS TOKEN>
|
||||||
|
api_version = 4
|
||||||
|
"""
|
||||||
|
raise SystemExit(msg)
|
||||||
|
|
||||||
if project_id:
|
if project_id:
|
||||||
self.project = self.gitlab_inst.projects.get(project_id, lazy=True)
|
self.project = self.gitlab_inst.projects.get(project_id, lazy=True)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user