2020-05-05 07:22:26 +00:00
|
|
|
load("@prysm//tools/go:def.bzl", "go_library")
|
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_test")
|
2018-07-22 17:31:43 +00:00
|
|
|
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
2020-11-21 21:37:03 +00:00
|
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle", "container_image")
|
2020-04-07 03:01:20 +00:00
|
|
|
load("//tools:go_image.bzl", "go_image_alpine", "go_image_debug")
|
2019-07-21 00:40:03 +00:00
|
|
|
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
|
2018-07-11 22:29:31 +00:00
|
|
|
|
|
|
|
go_library(
|
|
|
|
name = "go_default_library",
|
2019-03-01 19:48:05 +00:00
|
|
|
srcs = [
|
|
|
|
"main.go",
|
|
|
|
"usage.go",
|
|
|
|
],
|
2018-07-20 21:31:26 +00:00
|
|
|
importpath = "github.com/prysmaticlabs/prysm/beacon-chain",
|
2018-07-12 17:00:37 +00:00
|
|
|
visibility = ["//beacon-chain:__subpackages__"],
|
2018-07-14 02:15:37 +00:00
|
|
|
deps = [
|
2020-12-07 20:36:43 +00:00
|
|
|
"//beacon-chain/db:go_default_library",
|
2019-07-23 13:58:20 +00:00
|
|
|
"//beacon-chain/flags:go_default_library",
|
2018-07-14 02:15:37 +00:00
|
|
|
"//beacon-chain/node:go_default_library",
|
2018-07-19 16:31:50 +00:00
|
|
|
"//shared/cmd:go_default_library",
|
2018-07-14 03:35:15 +00:00
|
|
|
"//shared/debug:go_default_library",
|
2019-03-21 02:57:25 +00:00
|
|
|
"//shared/featureconfig:go_default_library",
|
2020-12-15 20:01:51 +00:00
|
|
|
"//shared/fileutil:go_default_library",
|
2020-10-14 00:10:57 +00:00
|
|
|
"//shared/journald:go_default_library",
|
2019-05-22 13:22:11 +00:00
|
|
|
"//shared/logutil:go_default_library",
|
2020-07-11 00:57:43 +00:00
|
|
|
"//shared/maxprocs:go_default_library",
|
2020-10-15 02:05:30 +00:00
|
|
|
"//shared/tos:go_default_library",
|
2019-01-10 04:19:33 +00:00
|
|
|
"//shared/version:go_default_library",
|
2020-04-18 06:23:45 +00:00
|
|
|
"@com_github_ethereum_go_ethereum//log:go_default_library",
|
2020-05-31 06:44:34 +00:00
|
|
|
"@com_github_ipfs_go_log_v2//:go_default_library",
|
2019-05-14 00:43:04 +00:00
|
|
|
"@com_github_joonix_log//:go_default_library",
|
2018-07-14 02:15:37 +00:00
|
|
|
"@com_github_sirupsen_logrus//:go_default_library",
|
2020-05-31 06:44:34 +00:00
|
|
|
"@com_github_urfave_cli_v2//:go_default_library",
|
2020-12-03 20:38:00 +00:00
|
|
|
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
|
2018-07-14 02:15:37 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-07-22 17:31:43 +00:00
|
|
|
go_image(
|
|
|
|
name = "image",
|
2020-03-26 00:36:28 +00:00
|
|
|
base = select({
|
|
|
|
"//tools:base_image_alpine": "//tools:alpine_cc_image",
|
|
|
|
"//tools:base_image_cc": "//tools:cc_image",
|
|
|
|
"//conditions:default": "//tools:cc_image",
|
|
|
|
}),
|
2020-11-10 03:01:56 +00:00
|
|
|
binary = ":beacon-chain",
|
2018-08-22 02:59:36 +00:00
|
|
|
tags = ["manual"],
|
2018-07-30 14:04:47 +00:00
|
|
|
visibility = ["//visibility:private"],
|
2018-07-22 17:31:43 +00:00
|
|
|
)
|
|
|
|
|
2020-11-21 21:37:03 +00:00
|
|
|
container_image(
|
|
|
|
name = "image_with_creation_time",
|
|
|
|
base = "image",
|
|
|
|
stamp = True,
|
|
|
|
)
|
|
|
|
|
2019-07-20 04:55:09 +00:00
|
|
|
container_bundle(
|
2019-07-21 00:40:03 +00:00
|
|
|
name = "image_bundle",
|
2019-07-20 04:55:09 +00:00
|
|
|
images = {
|
2020-11-21 21:37:03 +00:00
|
|
|
"gcr.io/prysmaticlabs/prysm/beacon-chain:latest": ":image_with_creation_time",
|
|
|
|
"gcr.io/prysmaticlabs/prysm/beacon-chain:{DOCKER_TAG}": ":image_with_creation_time",
|
|
|
|
"index.docker.io/prysmaticlabs/prysm-beacon-chain:latest": ":image_with_creation_time",
|
|
|
|
"index.docker.io/prysmaticlabs/prysm-beacon-chain:{DOCKER_TAG}": ":image_with_creation_time",
|
2019-07-20 04:55:09 +00:00
|
|
|
},
|
2018-08-22 02:59:36 +00:00
|
|
|
tags = ["manual"],
|
2018-07-30 14:04:47 +00:00
|
|
|
)
|
|
|
|
|
2020-02-17 22:13:34 +00:00
|
|
|
go_image_debug(
|
|
|
|
name = "image_debug",
|
|
|
|
image = ":image",
|
2020-03-26 00:36:28 +00:00
|
|
|
tags = ["manual"],
|
2020-02-17 22:13:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
container_bundle(
|
|
|
|
name = "image_bundle_debug",
|
|
|
|
images = {
|
|
|
|
"gcr.io/prysmaticlabs/prysm/beacon-chain:latest-debug": ":image_debug",
|
|
|
|
"gcr.io/prysmaticlabs/prysm/beacon-chain:{DOCKER_TAG}-debug": ":image_debug",
|
2020-06-12 17:06:12 +00:00
|
|
|
"index.docker.io/prysmaticlabs/prysm-beacon-chain:latest-debug": ":image_debug",
|
|
|
|
"index.docker.io/prysmaticlabs/prysm-beacon-chain:{DOCKER_TAG}-debug": ":image_debug",
|
2020-02-17 22:13:34 +00:00
|
|
|
},
|
|
|
|
tags = ["manual"],
|
|
|
|
)
|
|
|
|
|
2020-03-26 00:36:28 +00:00
|
|
|
go_image_alpine(
|
|
|
|
name = "image_alpine",
|
|
|
|
image = ":image",
|
|
|
|
tags = ["manual"],
|
|
|
|
)
|
|
|
|
|
|
|
|
container_bundle(
|
|
|
|
name = "image_bundle_alpine",
|
|
|
|
images = {
|
|
|
|
"gcr.io/prysmaticlabs/prysm/beacon-chain:latest-alpine": ":image_alpine",
|
|
|
|
"gcr.io/prysmaticlabs/prysm/beacon-chain:{DOCKER_TAG}-alpine": ":image_alpine",
|
2020-06-12 17:06:12 +00:00
|
|
|
"index.docker.io/prysmaticlabs/prysm-beacon-chain:latest-alpine": ":image_alpine",
|
|
|
|
"index.docker.io/prysmaticlabs/prysm-beacon-chain:{DOCKER_TAG}-alpine": ":image_alpine",
|
2020-03-26 00:36:28 +00:00
|
|
|
},
|
|
|
|
tags = ["manual"],
|
|
|
|
)
|
|
|
|
|
2019-07-21 00:40:03 +00:00
|
|
|
docker_push(
|
|
|
|
name = "push_images",
|
|
|
|
bundle = ":image_bundle",
|
|
|
|
tags = ["manual"],
|
|
|
|
)
|
|
|
|
|
2020-02-17 22:13:34 +00:00
|
|
|
docker_push(
|
|
|
|
name = "push_images_debug",
|
|
|
|
bundle = ":image_bundle_debug",
|
|
|
|
tags = ["manual"],
|
|
|
|
)
|
|
|
|
|
2020-03-26 00:36:28 +00:00
|
|
|
docker_push(
|
|
|
|
name = "push_images_alpine",
|
|
|
|
bundle = ":image_bundle_alpine",
|
|
|
|
tags = ["manual"],
|
|
|
|
)
|
|
|
|
|
2018-07-14 02:15:37 +00:00
|
|
|
go_binary(
|
|
|
|
name = "beacon-chain",
|
|
|
|
embed = [":go_default_library"],
|
2019-11-15 18:56:26 +00:00
|
|
|
visibility = [
|
|
|
|
"//beacon-chain:__subpackages__",
|
|
|
|
"//endtoend:__pkg__",
|
|
|
|
],
|
2018-07-11 22:29:31 +00:00
|
|
|
)
|
2019-06-02 15:33:44 +00:00
|
|
|
|
|
|
|
go_test(
|
|
|
|
name = "go_default_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["usage_test.go"],
|
|
|
|
embed = [":go_default_library"],
|
2020-03-19 21:46:44 +00:00
|
|
|
deps = [
|
|
|
|
"//shared/featureconfig:go_default_library",
|
2020-05-31 06:44:34 +00:00
|
|
|
"@com_github_urfave_cli_v2//:go_default_library",
|
2020-03-19 21:46:44 +00:00
|
|
|
],
|
2019-06-02 15:33:44 +00:00
|
|
|
)
|