load(
"@prelude-si//:macros.bzl",
"docker_image",
"export_file",
"nix_omnibus_pkg",
"rootfs",
"rust_binary",
"shellcheck",
"shfmt_check",
"test_suite",
)
test_suite(
name = "check-lint",
tests = [
":check-lint-rust-bin",
":check-lint-rust-unit",
":check-lint-shell",
],
)
test_suite(
name = "check-format",
tests = [
":check-format-rust",
":check-format-shell",
],
)
rust_binary(
name = "cyclone",
deps = [
"//lib/cyclone-server:cyclone-server",
"//lib/si-service:si-service",
"//third-party/rust:clap",
"//third-party/rust:tokio",
] + select({
"DEFAULT": [],
"config//os:linux": [
"//lib/si-firecracker:si-firecracker",
],
}),
srcs = glob(["src/**/*.rs"]),
env = {"CARGO_BIN_NAME": "cyclone"},
# TODO(fnichol): For now, disable Git metadata for Docker builds (no .git directory available)
git_metadata = False,
)
export_file(
name = "docker-entrypoint.sh",
)
shfmt_check(
name = "check-format-shell",
srcs = [":docker-entrypoint.sh"],
)
shellcheck(
name = "check-lint-shell",
srcs = [":docker-entrypoint.sh"],
)
docker_image(
name = "image",
image_name = "cyclone",
flake_lock = "//:flake.lock",
build_deps = [
"//bin/cyclone:docker-entrypoint.sh",
"//bin/cyclone:cyclone",
"//bin/lang-js:lang-js",
],
)
rootfs(
name = "rootfs",
pkg_name = "cyclone",
rootfs_name = "cyclone-rootfs",
build_deps = [
":cyclone",
"//bin/lang-js:lang-js",
],
)