forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhitl.Tiltfile
More file actions
50 lines (42 loc) · 1.37 KB
/
hitl.Tiltfile
File metadata and controls
50 lines (42 loc) · 1.37 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
# constants
ZENDESK_PORT = 3795
HIT_LOOPER_PORT = 3796
BOT_CACHE_PATH = './bots/hit-looper/.botpress/project.cache.json'
# resources
local_resource(
name='run-zendesk',
serve_cmd=" ".join([
"pnpm -F @botpresshub/zendesk exec",
"bp dev -y",
"--port %s" % ZENDESK_PORT,
]),
readiness_probe=probe(http_get=http_get_action(port=ZENDESK_PORT, path='/health'), period_secs=1, failure_threshold=10),
)
local_resource(
name='build-hitl-plugin',
cmd="pnpm turbo -F @botpresshub/hitl-plugin build && pnpm -F @bp-bots/hit-looper exec bp add -y --use-dev",
deps=['./plugins/hitl/src'],
)
local_resource(
name='run-hit-looper',
serve_cmd="pnpm -F @bp-bots/hit-looper exec bp dev --port %s" % HIT_LOOPER_PORT,
resource_deps=['build-hitl-plugin', 'run-zendesk'],
readiness_probe=probe(http_get=http_get_action(port=HIT_LOOPER_PORT, path='/health'), period_secs=1, failure_threshold=10),
)
local_resource(
name='reset-hit-looper',
cmd="rm %s" % BOT_CACHE_PATH,
auto_init=False,
)
bot_cache = read_json(BOT_CACHE_PATH, {})
if ('devId' in bot_cache):
bot_id = bot_cache['devId']
cmd = "bp chat %s" % bot_id
print("\n".join([
"",
"#######################################################",
"### To chat with your bot, run command: ###",
"### >> %s ###" % cmd,
"#######################################################",
"",
]))