mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
This PR fixes the setup we have for the node_module mirrors vars that are overriding and pointing into our middle cache. The previous configuration was not working as intended as the env vars set globally on CI never ended up in the bazel managed yarn install. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
67 lines
3.2 KiB
Text
67 lines
3.2 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 = {
|
|
"18.17.0-darwin_amd64": ("node-v18.17.0-darwin-x64.tar.gz", "node-v18.17.0-darwin-x64", "2f381442381f7fbde2ca644c3275bec9c9c2a8d361f467b40e39428acdd6ccff"),
|
|
"18.17.0-darwin_arm64": ("node-v18.17.0-darwin-arm64.tar.gz", "node-v18.17.0-darwin-arm64", "19731ef427e77ad9c5f476eb62bfb02a7f179d3012feed0bbded62e45f23e679"),
|
|
"18.17.0-linux_arm64": ("node-v18.17.0-linux-arm64.tar.xz", "node-v18.17.0-linux-arm64", "fbd2904178ee47da6e0386bc9704a12b1f613da6ad194878a517d4a69ba56544"),
|
|
"18.17.0-linux_amd64": ("node-v18.17.0-linux-x64.tar.xz", "node-v18.17.0-linux-x64", "f36facda28c4d5ce76b3a1b4344e688d29d9254943a47f2f1909b1a10acb1959"),
|
|
"18.17.0-windows_amd64": ("node-v18.17.0-win-x64.zip", "node-v18.17.0-win-x64", "06e30b4e70b18d794651ef132c39080e5eaaa1187f938721d57edae2824f4e96"),
|
|
},
|
|
node_version = "18.17.0",
|
|
node_urls = [
|
|
"https://nodejs.org/dist/v{version}/{filename}",
|
|
],
|
|
yarn_repositories = {
|
|
"1.22.19": ("yarn-v1.22.19.tar.gz", "yarn-v1.22.19", "732620bac8b1690d507274f025f3c6cfdc3627a84d9642e38a07452cc00e0f2e"),
|
|
},
|
|
yarn_version = "1.22.19",
|
|
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",
|
|
"SASS_BINARY_SITE": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass",
|
|
"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",
|
|
}
|
|
)
|