-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathTiltfile
30 lines (25 loc) · 1.04 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
# -*- mode: Python -*
k8s_yaml('kubernetes.yaml')
k8s_resource('example-python', port_forwards=8000,
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-python-image', '.', build_args={'flask_debug': 'True'},
live_update=[
sync('.', '/app'),
run('cd /app && pip install -r requirements.txt',
trigger='./requirements.txt'),
# 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/app.py', trigger='./start-time.txt'),
# add a congrats message!
run('sed -i "s/Hello cats!/{}/g" /app/templates/index.html'.
format(congrats)),
])