-
Notifications
You must be signed in to change notification settings - Fork 13
/
Tiltfile
35 lines (29 loc) · 1.14 KB
/
Tiltfile
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
# -*- mode: Python -*
k8s_yaml('kubernetes.yaml')
k8s_resource('example-nodejs', port_forwards=[
8000, # app itself
9229 # debugger
], resource_deps=['deploy']
)
# Records the current time, then kicks off a server update.
# Normally, you would let Tilt do deploys automatically, but this
# shows you how to set up a custom workflow that measures it.
local_resource(
'deploy',
'python3 now.py > start-time.txt',
)
# Add a live_update rule to our docker_build
congrats = "🎉 Congrats, you ran a live_update! 🎉"
docker_build('example-nodejs-image', '.',
build_args={'node_env': 'development'},
entrypoint='yarn run nodemon --inspect=0.0.0.0:9229 /app/index.js',
live_update=[
sync('.', '/app'),
run('cd /app && yarn install', trigger=['./package.json', './yarn.lock']),
# if all that changed was start-time.txt, make sure the server
# reloads so that it will reflect the new startup time
run('touch /app/index.js', trigger='./start-time.txt'),
# add a congrats message!
run('sed -i "s/Hello cats!/{}/g" /app/views/index.mustache'.
format(congrats)),
])