kibana/WORKSPACE.bazel
Kibana Machine fc94811899
[8.9] fix(NA): yarn env vars for node_modules mirrors (#163549) (#163617)
# Backport

This will backport the following commits from `main` to `8.9`:
- [fix(NA): yarn env vars for node_modules mirrors
(#163549)](https://github.com/elastic/kibana/pull/163549)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2023-08-10T14:35:34Z","message":"fix(NA):
yarn env vars for node_modules mirrors (#163549)\n\nThis PR fixes the
setup we have for the node_module mirrors vars that\r\nare overriding
and pointing into our middle cache. The previous\r\nconfiguration was
not working as intended as the env vars set globally\r\non CI never
ended up in the bazel managed yarn install.\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"17936ffd21d4b4b274d2cda90902764ed0d4ae07","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.10.0"],"number":163549,"url":"https://github.com/elastic/kibana/pull/163549","mergeCommit":{"message":"fix(NA):
yarn env vars for node_modules mirrors (#163549)\n\nThis PR fixes the
setup we have for the node_module mirrors vars that\r\nare overriding
and pointing into our middle cache. The previous\r\nconfiguration was
not working as intended as the env vars set globally\r\non CI never
ended up in the bazel managed yarn install.\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"17936ffd21d4b4b274d2cda90902764ed0d4ae07"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163549","number":163549,"mergeCommit":{"message":"fix(NA):
yarn env vars for node_modules mirrors (#163549)\n\nThis PR fixes the
setup we have for the node_module mirrors vars that\r\nare overriding
and pointing into our middle cache. The previous\r\nconfiguration was
not working as intended as the env vars set globally\r\non CI never
ended up in the bazel managed yarn install.\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"17936ffd21d4b4b274d2cda90902764ed0d4ae07"}}]}]
BACKPORT-->

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-08-10 08:54:50 -07:00

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 = {
"16.20.2-darwin_amd64": ("node-v16.20.2-darwin-x64.tar.gz", "node-v16.20.2-darwin-x64", "d7a46eaf2b57ffddeda16ece0d887feb2e31a91ad33f8774da553da0249dc4a6"),
"16.20.2-darwin_arm64": ("node-v16.20.2-darwin-arm64.tar.gz", "node-v16.20.2-darwin-arm64", "6a5c4108475871362d742b988566f3fe307f6a67ce14634eb3fbceb4f9eea88c"),
"16.20.2-linux_arm64": ("node-v16.20.2-linux-arm64.tar.xz", "node-v16.20.2-linux-arm64", "e88d86154d1ce53dc52fd74d79d4bfdf0b05f58c0bb2639adfa36e9378b770c4"),
"16.20.2-linux_amd64": ("node-v16.20.2-linux-x64.tar.xz", "node-v16.20.2-linux-x64", "874463523f26ed528634580247f403d200ba17a31adf2de98a7b124c6eb33d87"),
"16.20.2-windows_amd64": ("node-v16.20.2-win-x64.zip", "node-v16.20.2-win-x64", "f8bb35f6c08dc7bf14ac753509c06ed1a7ebf5b390cd3fbdc8f8c1aedd020ec3"),
},
node_version = "16.20.2",
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",
}
)