From 25074d80d3a2591828976384aa599bcb4b98a170 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 9 Jul 2022 21:58:34 +0300 Subject: [PATCH] Allowed specifying project environments for "pio ci" command // Resolve #4347 --- HISTORY.rst | 1 + docs | 2 +- platformio/commands/ci.py | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 96fc3fea..dee938c3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,7 @@ PlatformIO Core 6 6.1.1 (2022-??-??) ~~~~~~~~~~~~~~~~~~ +* Allowed specifying project environments for `pio ci `__ command (`issue #4347 `_) * Show "TimeoutError" only in the verbose mode when can not find a serial port * Fixed an issue when a serial port was not automatically detected if the board has predefined HWIDs * Fixed an issue with endless scanning of project dependencies (`issue #4349 `_) diff --git a/docs b/docs index c72ff5c9..31b7d077 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit c72ff5c9017e23f2d524bde4b292af5e3b269108 +Subproject commit 31b7d077be62b407798c69ea624fc6a28ebc64ac diff --git a/platformio/commands/ci.py b/platformio/commands/ci.py index 9364d1e9..e62d1ca9 100644 --- a/platformio/commands/ci.py +++ b/platformio/commands/ci.py @@ -62,6 +62,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument ), ) @click.option("-O", "--project-option", multiple=True) +@click.option("-e", "--environment", "environments", multiple=True) @click.option("-v", "--verbose", is_flag=True) @click.pass_context def cli( # pylint: disable=too-many-arguments, too-many-branches @@ -74,9 +75,9 @@ def cli( # pylint: disable=too-many-arguments, too-many-branches keep_build_dir, project_conf, project_option, + environments, verbose, ): - if not src and os.getenv("PLATFORMIO_CI_SRC"): src = validate_path(ctx, None, os.getenv("PLATFORMIO_CI_SRC").split(":")) if not src: @@ -115,7 +116,9 @@ def cli( # pylint: disable=too-many-arguments, too-many-branches ) # process project - ctx.invoke(cmd_run, project_dir=build_dir, verbose=verbose) + ctx.invoke( + cmd_run, project_dir=build_dir, environment=environments, verbose=verbose + ) finally: if not keep_build_dir: fs.rmtree(build_dir)