github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/integration/same_img_multi_container/Tiltfile (about)

     1  # -*- mode: Python -*-
     2  
     3  include('../Tiltfile')
     4  
     5  load('ext://restart_process', 'docker_build_with_restart')
     6  
     7  # If you get push errors, you can change the default_registry.
     8  # Create tilt_option.json with contents: {"default_registry": "gcr.io/my-personal-project"}
     9  # (with your registry inserted). tilt_option.json is gitignore'd, unlike Tiltfile
    10  default_registry(read_json('tilt_option.json', {})
    11                   .get('default_registry', 'gcr.io/windmill-test-containers/servantes'))
    12  
    13  # We've specifically constructed this image to exercise the three most
    14  # common Live Update codepaths:
    15  # 1) A SYNC step
    16  # 2) A RUN step that executes at build time (cp source.txt compiled.txt)
    17  # 3) Process restart (via `docker_build_with_restart`)
    18  docker_build_with_restart('sameimg', '.',
    19               entrypoint=['/src/main.sh'],
    20               live_update=[
    21                   sync('.', '/src'),
    22                   run('cp source.txt compiled.txt'),
    23               ])
    24  k8s_yaml('sameimg.yaml')
    25  k8s_resource('sameimg', port_forwards=['8100:8000', '8101:8001'])