forked from weisi/bazel_for_gcloud_python
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBUILD
61 lines (49 loc) · 1.4 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
load("@bazel_for_gcloud_python//infra/serverless:gcf_rules.bzl", "py_cloud_function")
py_library(
name = "gcf_utils",
srcs = [
"gcf_utils.py",
],
visibility = ["//visibility:public"],
)
py_binary(
name = "hello",
srcs = [
"hello.py",
],
deps = [
":gcf_utils",
]
)
filegroup(
name = "hello_zip",
srcs = [":hello"],
output_group = "python_zip_file",
)
# 'bazel run' this rule to trigger deployment.
py_cloud_function(
# Required parameters:
name = "hello_deploy",
srcs = [":hello", ":hello_zip"],
entry = "hello",
# Specify your pip requirements here:
# requirements = [
# "google-cloud-logging",
# ],
# or specify them in another file:
# requirements_file = "//function:requirements.txt"
# Specify a GCP project name instead of using the default:
# gcloud_project = "my-gcp-project",
# The function name that appears in HTTP path:
# deploy_name = "function_name",
# Use pubsub as a trigger instead of HTTP:
# trigger_topic = "pubsub_topic",
# Use GCS as a trigger instead of HTTP:
# trigger_bucket = "my_gcs_bucket",
# Specify the memory limit in MiB (default is 256 MiB):
# memory = 2048,
# Specify the timeout of the function in seconds (default is 60 s):
# timeout = 200,
# Print the arguments for debugging when running the rule:
# debug = True,
)