-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathTiltfile
42 lines (36 loc) · 1.34 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
36
37
38
39
40
41
42
# -*- mode: Python -*-
# For more on Extensions, see: https://docs.tilt.dev/extensions.html
load('ext://restart_process', 'docker_build_with_restart')
# 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 record-start-time.py',
)
gradlew = "./gradlew"
if os.name == "nt":
gradlew = "gradlew.bat"
local_resource(
'example-java-compile',
gradlew + ' bootJar && ' +
'rm -rf build/jar-staging && ' +
'java -Djarmode=layertools -jar build/libs/example-0.0.1-SNAPSHOT.jar extract --destination build/jar-extracted && ' +
'rsync --delete --inplace --checksum -r build/jar-extracted/ build/jar',
deps=['src', 'build.gradle'],
resource_deps = ['deploy'])
docker_build_with_restart(
'example-java-image',
'./build/jar',
entrypoint=['java', 'org.springframework.boot.loader.JarLauncher'],
dockerfile='./Dockerfile',
live_update=[
sync('./build/jar/dependencies', '/app'),
sync('./build/jar/spring-boot-loader', '/app'),
sync('./build/jar/snapshot-dependencies', '/app'),
sync('./build/jar/application', '/app'),
],
)
k8s_yaml('kubernetes.yaml')
k8s_resource('example-java', port_forwards=8000,
resource_deps=['deploy', 'example-java-compile'])