| commit | 54e9a0e7be90a65169b64394f41180a2303c1f99 | [log] [tgz] |
|---|---|---|
| author | Jakob Buchgraber <buchgr@google.com> | Wed Apr 01 04:22:19 2020 -0700 |
| committer | Copybara-Service <copybara-worker@google.com> | Wed Apr 01 04:23:35 2020 -0700 |
| tree | f7f349f95290b4a19d690eb62bb6994a8e568250 | |
| parent | f6d205c7ac2ba2d59cdb45e3a2a2908b66ca871b [diff] |
remote: add file uploads to repository_ctx.execute
This change adds file uploads to repository_ctx.execute when used with
--experimental_repo_remote_exec and remote execution. When passing a
Label as an argument the respective file is uploaded and added as an
input to the remote action. The Label argument is converted to the
remote path of the file. Labels in the main workspace are translated
to their workspace relative part. Labels in external repositories are
translated to paths starting with external/<repo_name>/....
Example:
repository_ctx.execute([Label("//config:find_config.py"),
Label("@foo_repo//config:options.json"), "foo"])
This will upload both find_config.py and options.json and stage them on
the remote machine at
./config/find_config.py
./external/foo_repo/config/options.json
and execute the command "./config/find_config.py
./external/foo_repo/config/options.json foo" on the remote machine. For
local execution the paths will refer to machines.
Additional information at https://docs.google.com/document/d/1V0EbErjsg24lmwTn21Z3_0K9tmzg9kk8VOCestNrri4/edit#heading=h.os7cq3rrq6dl
Closes #11021.
PiperOrigin-RevId: 304156907
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md