豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 5f7f2df

Browse files
committed
feat(apps): allow for firebase functions to be deployed via bazel
Sets up deploying firebase functions using a nodejs_binary rule.
1 parent 01394f7 commit 5f7f2df

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

apps/BUILD.bazel

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,34 @@ nodejs_binary(
1414
entry_point = "@npm//:node_modules/firebase-tools/lib/bin/firebase.js",
1515
templated_args = [
1616
"--project",
17-
"angular-caretaker",
17+
"internal-200822",
1818
"--config",
1919
# TODO: Find a way to do this without relying on the copy_to_bin that works cross platform.
2020
"$$(rlocation $(execpath :firebase.json))",
2121
"emulators:start",
2222
],
2323
)
24+
25+
nodejs_binary(
26+
name = "deploy",
27+
chdir = package_name(),
28+
data = [
29+
# primary firebase configuration file
30+
"firebase.json",
31+
32+
# Firebase function files
33+
"//apps/functions:functions_compiled",
34+
"//apps/functions:functions_files",
35+
],
36+
entry_point = "@npm//:node_modules/firebase-tools/lib/bin/firebase.js",
37+
templated_args = [
38+
"--project",
39+
"internal-200822",
40+
"--config",
41+
# TODO: Find a way to do this without relying on the copy_to_bin that works cross platform.
42+
"$$(rlocation $(execpath :firebase.json))",
43+
"deploy",
44+
"--only",
45+
"functions",
46+
],
47+
)

apps/firebase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"functions": {
77
"predeploy": "bazel build //apps/functions:functions_compiled",
8-
"source": "../dist/bin/apps/functions"
8+
"source": "./functions/dist/functions"
99
},
1010
"emulators": {
1111
"functions": {

apps/functions/dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../dist/bin/apps/

apps/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"engines": {
44
"node": "16"
55
},
6-
"main": "index.js",
6+
"main": "functions_compiled/index.js",
77
"private": true
88
}

0 commit comments

Comments
 (0)