sourcegraph/cmd/loadtest/BUILD.bazel
Noah S-C b9c4e2aae9
Revert "Revert "refactor: upgrade to rules_oci 2.0 (2nd attempt)"" (#64354)
Reverts sourcegraph/sourcegraph#64351

## Test plan

Need to test on main due to main-only CI steps (even with main dry-run)
2024-08-08 09:00:08 +00:00

67 lines
1.5 KiB
Python

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//dev:oci_defs.bzl", "image_repository", "oci_image", "oci_push", "oci_tarball")
load("//dev:oci_defs.bzl", "pkg_tar")
load("@container_structure_test//:defs.bzl", "container_structure_test")
go_library(
name = "loadtest_lib",
srcs = ["main.go"],
importpath = "github.com/sourcegraph/sourcegraph/cmd/loadtest",
tags = [TAG_PLATFORM_SEARCH],
visibility = ["//visibility:private"],
deps = [
"//internal/env",
"//internal/sanitycheck",
"//lib/errors",
"@com_github_sourcegraph_log//:log",
],
)
go_binary(
name = "loadtest",
embed = [":loadtest_lib"],
tags = [TAG_PLATFORM_SEARCH],
visibility = ["//visibility:public"],
)
pkg_tar(
name = "tar_loadtest",
srcs = [":loadtest"],
)
oci_image(
name = "image",
base = "//wolfi-images/sourcegraph-base:base_image",
entrypoint = [
"/sbin/tini",
"--",
"/loadtest",
],
tars = [":tar_loadtest"],
)
oci_tarball(
name = "image_tarball",
image = ":image",
repo_tags = ["loadtest:candidate"],
)
container_structure_test(
name = "image_test",
timeout = "short",
configs = ["image_test.yaml"],
driver = "docker",
image = ":image",
tags = [
"exclusive",
"requires-network",
TAG_PLATFORM_SEARCH,
],
)
oci_push(
name = "candidate_push",
image = ":image",
repository = image_repository("loadtest"),
)