-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevloop.toml
More file actions
97 lines (82 loc) · 2.72 KB
/
devloop.toml
File metadata and controls
97 lines (82 loc) · 2.72 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Generic blog example for devloop.
# Copy this file into your blog repository and adjust the values there.
root = "/path/to/your-blog-repo"
debounce_ms = 300
state_file = "./.devloop/state.json"
startup_workflows = ["startup"]
[watch.rust]
paths = ["src/**/*.rs", "Cargo.toml", "content/layout.html", "content/banner.html", "content/site.toml"]
workflow = "rust"
[watch.content]
paths = ["content/**/*.md", "content/**/*.html"]
workflow = "content"
[process.css_watch]
command = ["tailwindcss", "-i", "tailwind.css", "-o", "content/static/tailwind.css", "--watch=always"]
cwd = "."
autostart = false
[process.server]
command = ["cargo", "run"]
cwd = "."
autostart = false
env = { PORT = "18080" }
restart = "always"
[process.server.readiness]
kind = "http"
url = "http://127.0.0.1:18080/"
interval_ms = 500
timeout_ms = 30000
[process.tunnel]
command = ["cloudflared", "tunnel", "--url", "http://127.0.0.1:18080"]
cwd = "."
autostart = false
restart = "always"
output = { inherit = true, rules = [{ state_key = "tunnel_url", extract = "url_token" }] }
[process.tunnel.readiness]
kind = "state_key"
key = "tunnel_url"
interval_ms = 250
timeout_ms = 30000
[hook.build_css]
command = ["./scripts/build-css.sh"]
cwd = "."
[hook.current_browser_path]
command = ["./scripts/current-browser-path.sh"]
cwd = "."
env = { PORT = "18080" }
capture = "text"
state_key = "current_browser_path"
[event.browser_path]
state_key = "current_browser_path"
workflow = "publish_post_url"
pattern = "^/(|posts/[a-z0-9-]+)$"
[workflow.publish_post_url]
steps = [
{ action = "wait_for_process", process = "tunnel" },
{ action = "write_state", key = "current_post_url", value = "{{tunnel_url}}{{current_browser_path}}" },
{ action = "log", message = "current post url: {{current_post_url}}", style = "boxed" },
]
[workflow.startup]
steps = [
{ action = "start_process", process = "css_watch" },
{ action = "start_process", process = "server" },
{ action = "wait_for_process", process = "server" },
{ action = "run_hook", hook = "build_css" },
{ action = "run_hook", hook = "current_browser_path" },
{ action = "start_process", process = "tunnel" },
{ action = "run_workflow", workflow = "publish_post_url" },
]
[workflow.rust]
steps = [
{ action = "restart_process", process = "server" },
{ action = "wait_for_process", process = "server" },
{ action = "run_hook", hook = "build_css" },
{ action = "run_hook", hook = "current_browser_path" },
{ action = "restart_process", process = "tunnel" },
{ action = "run_workflow", workflow = "publish_post_url" },
]
[workflow.content]
steps = [
{ action = "run_hook", hook = "current_browser_path" },
{ action = "restart_process", process = "tunnel" },
{ action = "run_workflow", workflow = "publish_post_url" },
]