mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
66 lines
3.1 KiB
Text
66 lines
3.1 KiB
Text
# Define the workspace base name and a managed directory by bazel
|
|
# that will hold the node_modules called @npm
|
|
workspace(
|
|
name = "kibana",
|
|
managed_directories = {"@npm": ["node_modules"]},
|
|
)
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
# Fetch Node.js rules
|
|
http_archive(
|
|
name = "build_bazel_rules_nodejs",
|
|
patch_args = ["-p1"],
|
|
patches = ["//:src/dev/bazel/rules_nodejs_patches/normalized_paths_for_windows_runfiles.patch"],
|
|
sha256 = "6f15d75f9e99c19d9291ff8e64e4eb594a6b7d25517760a75ad3621a7a48c2df",
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.7.0/rules_nodejs-4.7.0.tar.gz"],
|
|
)
|
|
|
|
# Now that we have the rules let's import from them to complete the work
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
|
|
|
|
# Setup the Node.js toolchain for the architectures we want to support
|
|
node_repositories(
|
|
node_repositories = {
|
|
"20.12.1-darwin_amd64": ("node-v20.12.1-darwin-x64.tar.gz", "node-v20.12.1-darwin-x64", "f5dc3c71c87c58c9b019d9f85302db3a6a6c47167c5a0480b697f153d02ac316"),
|
|
"20.12.1-darwin_arm64": ("node-v20.12.1-darwin-arm64.tar.gz", "node-v20.12.1-darwin-arm64", "65df8cb0724e3a58c7757b75a70cc1057e1f67ffc5e852bfe6241de0b37c70a0"),
|
|
"20.12.1-linux_arm64": ("node-v20.12.1-linux-arm64.tar.xz", "node-v20.12.1-linux-arm64", "903a0f94312ba819f16a133e9dc378db128804ff45ea69e11af7152c303e8a85"),
|
|
"20.12.1-linux_amd64": ("node-v20.12.1-linux-x64.tar.xz", "node-v20.12.1-linux-x64", "e43b54ecea97b4419a5526af57bcf4f22a3d5583e1b2cacf461da71b9ba2befe"),
|
|
"20.12.1-windows_amd64": ("node-v20.12.1-win-x64.zip", "node-v20.12.1-win-x64", "629e2619ef88c5a8ce9944201f00ca3124f079c43ceef7ab0826c6fd19e09d75"),
|
|
},
|
|
node_version = "20.12.1",
|
|
node_urls = [
|
|
"https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v{version}/{filename}",
|
|
],
|
|
yarn_repositories = {
|
|
"1.22.21": ("yarn-v1.22.21.tar.gz", "yarn-v1.22.21", "a55bb4e85405f5dfd6e7154a444e7e33ad305d7ca858bad8546e932a6688df08"),
|
|
},
|
|
yarn_version = "1.22.21",
|
|
yarn_urls = [
|
|
"https://github.com/yarnpkg/yarn/releases/download/v{version}/{filename}",
|
|
],
|
|
)
|
|
|
|
# Run yarn_install rule to take care of dependencies
|
|
#
|
|
# NOTE: FORCE_COLOR env var forces colors on non tty mode
|
|
yarn_install(
|
|
name = "npm",
|
|
package_json = "//:package.json",
|
|
yarn_lock = "//:yarn.lock",
|
|
data = [
|
|
"//:.yarnrc",
|
|
"//:preinstall_check.js",
|
|
],
|
|
exports_directories_only = True,
|
|
symlink_node_modules = True,
|
|
quiet = False,
|
|
frozen_lockfile = False,
|
|
environment = {
|
|
"GECKODRIVER_CDNURL": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache",
|
|
"CHROMEDRIVER_CDNURL": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache",
|
|
"CHROMEDRIVER_CDNBINARIESURL": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache",
|
|
"RE2_DOWNLOAD_MIRROR": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2",
|
|
"CYPRESS_DOWNLOAD_MIRROR": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/cypress",
|
|
}
|
|
)
|