Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
# -*- 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',
'python 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 && ' +
'unzip -o build/libs/example-0.0.1-SNAPSHOT.jar -d build/jar-staging && ' +
'rsync --delete --inplace --checksum -r build/jar-staging/ build/jar',
deps=['src', 'build.gradle'],
resource_deps = ['deploy'])
docker_build_with_restart(
'example-java-image',
'./build/jar',
entrypoint=['java', '-noverify', '-cp', '.:./lib/*', 'dev.tilt.example.ExampleApplication'],
dockerfile='./Dockerfile',
live_update=[
sync('./build/jar/BOOT-INF/lib', '/app/lib'),
sync('./build/jar/META-INF', '/app/META-INF'),
sync('./build/jar/BOOT-INF/classes', '/app'),
],
)
k8s_yaml('kubernetes.yaml')
k8s_resource('example-java', port_forwards=8000,
resource_deps=['deploy', 'example-java-compile'])