-
Notifications
You must be signed in to change notification settings - Fork 980
Expand file tree
/
Copy pathcopy.bara.sky
More file actions
79 lines (74 loc) · 2.6 KB
/
Copy pathcopy.bara.sky
File metadata and controls
79 lines (74 loc) · 2.6 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copybara config that imports API specs from their source-of-truth
# repositories into spec/. The imported files are tracked here but must not
# be edited by hand — `make codegen` re-fetches the infra ones at the commit
# pinned in spec/infra-ref before generating the clients, and the
# generated-files CI check fails if the tracked copies don't match the pin.
# See spec/README.md.
#
# scripts/fetch-spec.sh runs these workflows with `--folder-dir` pointing at
# spec/ itself. Each workflow's destination_files glob declares the spec/
# paths its upstream owns: after a successful fetch, Copybara replaces
# exactly those paths (so files deleted upstream are deleted here too) and
# leaves the repo-owned files in spec/ untouched.
INFRA_REPO = "https://github.com/e2b-dev/infra.git"
BELT_REPO = "https://github.com/e2b-dev/belt.git"
AUTHORING = authoring.pass_thru("E2B <hello@e2b.dev>")
# REST API spec -> spec/openapi.yml
core.workflow(
name = "api-spec",
origin = git.github_origin(
url = INFRA_REPO,
),
destination = folder.destination(),
origin_files = glob(["spec/openapi.yml"]),
destination_files = glob(["openapi.yml"]),
authoring = AUTHORING,
mode = "SQUASH",
transformations = [
core.move("spec/openapi.yml", "openapi.yml"),
],
)
# envd spec (HTTP API + protobufs) -> spec/envd/
core.workflow(
name = "envd-spec",
origin = git.github_origin(
url = INFRA_REPO,
),
destination = folder.destination(),
origin_files = glob(
[
"packages/envd/spec/envd.yaml",
"packages/envd/spec/filesystem/**",
"packages/envd/spec/process/**",
],
# This repo has its own buf generation templates in spec/envd.
exclude = ["packages/envd/spec/buf*.yaml"],
),
destination_files = glob([
"envd/envd.yaml",
"envd/filesystem/**",
"envd/process/**",
]),
authoring = AUTHORING,
mode = "SQUASH",
transformations = [
core.move("packages/envd/spec", "envd"),
],
)
# Volume-content API spec -> spec/openapi-volumecontent.yml
# belt is private, so the fetch authenticates with a GitHub token
# (see scripts/fetch-spec.sh).
core.workflow(
name = "volume-api-spec",
origin = git.github_origin(
url = BELT_REPO,
),
destination = folder.destination(),
origin_files = glob(["packages/volume-content/openapi.yml"]),
destination_files = glob(["openapi-volumecontent.yml"]),
authoring = AUTHORING,
mode = "SQUASH",
transformations = [
core.move("packages/volume-content/openapi.yml", "openapi-volumecontent.yml"),
],
)