Skip to content
Snippets Groups Projects
Commit c747e0fb authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

docker_build: Use Orus API token in PIP_INDEX_URL

parent 9316d438
No related branches found
No related merge requests found
......@@ -2,6 +2,11 @@
History
=======
20.14.0
-------
docker_build: Use the Orus API token if available (giving it to docker in the environment variable PIP_INDEX_URL)
20.13.0
-------
......
......@@ -17,6 +17,7 @@
from .docker_build_copy import add_build_copy_options, copy, get_build_copy_options
from .docker_client import DockerClient
from .parsing import apply, basic_parser
from .storage import get_orus_api_token
_logger = logging.getLogger(__name__)
......@@ -177,6 +178,15 @@
a = arg.split("=")
buildargs[a[0]] = a[1]
_logger.debug("Build args: %s", buildargs)
if nmspc.orus_api_token or get_orus_api_token():
buildargs[
"PIP_INDEX_URL"
] = f"https://__token__:{nmspc.orus_api_token or get_orus_api_token()}@orus.io/api/v4/groups/9/-/packages/pypi/simple" # noqa: E501
else:
if c.orus_api_token_required:
_logger.error(
"No Orus API token provided, the project indicates it is mandatory"
)
if dev:
debug_dockerfile = "Dockerfile.debug"
call(["cp", dockerfile, debug_dockerfile])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment