This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathBUILD.bazel
72 lines (64 loc) · 1.55 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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")
load("//wolfi-images:defs.bzl", "wolfi_base")
go_library(
name = "gitserver_lib",
srcs = ["main.go"],
importpath = "github.com/sourcegraph/sourcegraph/cmd/gitserver",
tags = [TAG_PLATFORM_SOURCE],
visibility = ["//visibility:private"],
deps = [
"//cmd/gitserver/shared",
"//internal/sanitycheck",
"//internal/service/svcmain",
],
)
go_binary(
name = "gitserver",
embed = [":gitserver_lib"],
tags = [TAG_PLATFORM_SOURCE],
visibility = ["//visibility:public"],
)
pkg_tar(
name = "tar_gitserver",
srcs = [":gitserver"],
)
oci_image(
name = "image",
base = ":base_image",
entrypoint = [
"/sbin/tini",
"--",
"/gitserver",
],
tars = [
":tar_gitserver",
],
user = "sourcegraph",
workdir = "/",
)
oci_tarball(
name = "image_tarball",
image = ":image",
repo_tags = ["gitserver:candidate"],
)
container_structure_test(
name = "image_test",
timeout = "short",
configs = ["image_test.yaml"],
driver = "docker",
image = ":image",
tags = [
"exclusive",
"requires-network",
TAG_PLATFORM_SOURCE,
],
)
oci_push(
name = "candidate_push",
image = ":image",
repository = image_repository("gitserver"),
)
wolfi_base()