shell_command
Execute any external tool for its side effects.
Example BUILD file:
shell_command(
command="./my-script.sh --flag",
tools=["tar", "curl", "cat", "bash", "env"],
execution_dependencies=[":scripts"],
output_files=["logs/my-script.log"],
output_directories=["results"],
)
shell_sources(name="scripts")
Remember to add this target to the dependencies of each consumer, such as your python_tests
or docker_image
. When relevant, Pants will run your command
and insert the outputs
into that consumer's context.
The command may be retried and/or cancelled, so ensure that it is idempotent.
Backend: pants.backend.shell