diff --git a/bin/ci/gitlab_common.py b/bin/ci/gitlab_common.py index 9f5cfd81656..22b60be325d 100644 --- a/bin/ci/gitlab_common.py +++ b/bin/ci/gitlab_common.py @@ -16,7 +16,9 @@ from functools import cache from pathlib import Path GITLAB_URL = "https://gitlab.freedesktop.org" -TOKEN_DIR = Path(os.getenv("XDG_CONFIG_HOME") or Path.home() / ".config") +TOKEN_DIR = Path(os.environ.get("XDG_CONFIG_HOME", "") + if os.environ.get("XDG_CONFIG_HOME", None) + else Path.home() / ".config") # Known GitLab token prefixes: https://docs.gitlab.com/security/tokens/#token-prefixes TOKEN_PREFIXES: dict[str, str] = { diff --git a/docs/ci/index.rst b/docs/ci/index.rst index 73bc81328cd..6ff6bb1764e 100644 --- a/docs/ci/index.rst +++ b/docs/ci/index.rst @@ -301,6 +301,8 @@ and cancel the rest to avoid wasting resources. See ``bin/ci/ci_run_n_monitor.py --help`` for all the options. +**Target jobs** + The ``--target`` argument takes a regex that you can use to select the jobs names you want to run, e.g. ``--target 'zink.*'`` will run all the Zink jobs, leaving the other drivers' jobs free for others to use. @@ -311,6 +313,22 @@ You can work around that by adding a dummy change in a file core to what you're working on and then making a new push with that change, and removing that change before you create the MR. +**GitLab token** + +The ``--token`` argument is used to provide a GitLab token with rights to +interact with the pipeline. Using the argument, one can provide the value or +the name of the file having the value. If the argument is not provided, then +it checks if the value of ``$XDG_CONFIG_HOME`` has a valid directory (if not, +then uses ``$HOME/.config``), and there is a file called ``gitlab-token`` that +contains a token. The token required to work with this tool needs ``api`` +scope permissions. + +.. note:: + To create that token, refer to + `create-a-personal-access-token `_ + and select the ``api`` scope. The token will only be shown once after creation, + so make sure you store it securely. + Conformance Tests -----------------