pio ci [OPTIONS] [SRC]
pio ci command is conceived of as “hot key” for building project with
arbitrary source code structure. In a nutshell, using SRC
and
pio ci --lib
contents PlatformIO initializes via
pio project init new project in pio ci --build-dir
with the build environments (using pio ci --board
or
pio ci --project-conf
) and processes them via pio run
command.
pio ci command accepts multiple SRC
arguments,
pio ci --lib
and pio ci --exclude
options
which can be a path to directory, file or
Glob Pattern.
Also, you can omit SRC
argument and set path (multiple paths are allowed
denoting with :
) to
PLATFORMIO_CI_SRC
Environment variable
For more details as for integration with the popular Continuous Integration Systems please follow to Continuous Integration page.
Note
pio ci command is useful for library developers. It allows one to build
different examples without creating own project per them. Also, is possible
to upload firmware to the target device. In this case, you need to pass
additional option --project-option="targets=upload"
. What is more,
you can specify custom upload port using
--project-option="upload_port=<port>"
option.
See pio ci --project-option
for details.
Source code which will be copied to <BUILD_DIR>/lib
directly.
If pio ci --lib
is a path to file (not to directory), then
PlatformIO will create temporary directory within <BUILD_DIR>/lib
and copy
the rest files into it.
Exclude directories and/-or files from pio ci --build-dir
. The
path must be relative to PlatformIO project within
pio ci --build-dir
.
For example, exclude from project src
directory:
examples
folder
*.h
files from foo
folder
pio ci --exclude=src/examples --exclude=src/foo/*.h [SRC]
Build project with automatically pre-generated environments based on board settings.
For more details please look into pio project init --board
.
Path to directory where PlatformIO will initialise new project. By default it’s temporary directory within your operating system.
Note
This directory will be removed at the end of build process. If you want to
keep it, please use pio ci --keep-build-dir
.
Don’t remove pio ci --build-dir
after build process.
Build project using pre-configured “platformio.ini” (Project Configuration File).
Pass additional options from “platformio.ini” (Project Configuration File) to pio project init command.
For example, automatically install dependent libraries
pio ci --project-option="lib_deps=ArduinoJSON"
or ignore specific
library pio ci --project-option="lib_ignore=SomeLib"
.
Note
Use multiple --project-option
to pass multiple options to
“platformio.ini” (Project Configuration File). One option per one argument. For example,
pio ci --project-option="build_unflags = -std=gnu++11" --project-option="build_flags = -std=c++14"
Shows detailed information when processing environments.
This option can also be set globally using force_verbose setting
or by environment variable PLATFORMIO_SETTING_FORCE_VERBOSE
.
For the others examples please follow to Continuous Integration page.