multirun

command
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

multirun

Bazel rule to bazel run multiple executable targets sequentially or in parallel.

Setup and usage via Bazel

WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# multirun is written in Go and hence needs rules_go to be built.
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
http_archive(
    name = "io_bazel_rules_go",
)

git_repository(
    name = "com_github_ash2k_bazel_tools",
    commit = "<commit>",
    remote = "https://github.com/ash2k/bazel-tools.git",
    shallow_since = "<bla>",
)

load("@com_github_ash2k_bazel_tools//multirun:deps.bzl", "multirun_dependencies")

multirun_dependencies()

BUILD.bazel file:

load("@com_github_ash2k_bazel_tools//multirun:def.bzl", "multirun", "command")

command(
    name = "command1",
    command = "//some/label",
    arguments = [
        "-arg1",
        "value1",
        "-arg2",
    ],
    environment = {
        "ABC": "DEF",
    },
    raw_environment = {
        "PATH": "$(pwd)/path",
    },
)

multirun(
    name = "run_all",
    commands = [
        ":command1",
        "//some/other:label",
    ],
)

multirun(
    name = "run_all_parallel",
    commands = [
        ":command1",
        "//some/other:label",
    ],
    jobs = 0,
)

Invoke with

bazel run //:run_all

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL