| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- # Welcome to Tilt!
- # To get you started as quickly as possible, we have created a
- # starter Tiltfile for you.
- #
- # Uncomment, modify, and delete any commands as needed for your
- # project's configuration.
- # Output diagnostic messages
- # You can print log messages, warnings, and fatal errors, which will
- # appear in the (Tiltfile) resource in the web UI. Tiltfiles support
- # multiline strings and common string operations such as formatting.
- #
- # More info: https://docs.tilt.dev/api.html#api.warn
- print("""
- -----------------------------------------------------------------
- ✨ Hello Tilt! This appears in the (Tiltfile) pane whenever Tilt
- evaluates this file.
- -----------------------------------------------------------------
- """.strip())
- # k8s_yaml('kubernetes.yaml')
- # docker_build(
- # 'socket-server-image',
- # context='./wsocketserver/',
- # dockerfile='./wsocketserver/dockerfile')
- # docker_build(
- # 'api-image',
- # context='./api/',
- # dockerfile='./api/dockerfile')
- # docker_build(
- # 'rabbitmq-image',
- # context='./rabbitmq/',
- # dockerfile='./rabbitmq/dockerfile')
- # docker_build(
- # 'serialreader-image',
- # context='./serialreader/',
- # dockerfile='./serialreader/dockerfile')
- # docker_build(
- # 'persistance-image',
- # context='./',
- # dockerfile='./persistance/dockerfile')
- docker_compose('./docker-compose.yml')
- # k8s_resource('socket-server', port_forwards=8082)
- # k8s_resource('rabbitmq', port_forwards=[15672,5672])
- # k8s_resource('api', port_forwards=8089)
- # Build Docker image
- # Tilt will automatically associate image builds with the resource(s)
- # that reference them (e.g. via Kubernetes or Docker Compose YAML).
- #
- # More info: https://docs.tilt.dev/api.html#api.docker_build
- #
- # docker_build('registry.example.com/my-image',
- # context='.',
- # # (Optional) Use a custom Dockerfile path
- # dockerfile='./deploy/app.dockerfile',
- # # (Optional) Filter the paths used in the build
- # only=['./app'],
- # # (Recommended) Updating a running container in-place
- # # https://docs.tilt.dev/live_update_reference.html
- # live_update=[
- # # Sync files from host to container
- # sync('./app', '/src/'),
- # # Execute commands inside the container when certain
- # # paths change
- # run('/src/codegen.sh', trigger=['./app/api'])
- # ]
- # )
- # Apply Kubernetes manifests
- # Tilt will build & push any necessary images, re-deploying your
- # resources as they change.
- #
- # More info: https://docs.tilt.dev/api.html#api.k8s_yaml
- #
- # k8s_yaml(['k8s/deployment.yaml', 'k8s/service.yaml'])
- # Customize a Kubernetes resource
- # By default, Kubernetes resource names are automatically assigned
- # based on objects in the YAML manifests, e.g. Deployment name.
- #
- # Tilt strives for sane defaults, so calling k8s_resource is
- # optional, and you only need to pass the arguments you want to
- # override.
- #
- # More info: https://docs.tilt.dev/api.html#api.k8s_resource
- #
- # k8s_resource('my-deployment',
- # # map one or more local ports to ports on your Pod
- # port_forwards=['5000:8080'],
- # # change whether the resource is started by default
- # auto_init=False,
- # # control whether the resource automatically updates
- # trigger_mode=TRIGGER_MODE_MANUAL
- # )
- # Run local commands
- # Local commands can be helpful for one-time tasks like installing
- # project prerequisites. They can also manage long-lived processes
- # for non-containerized services or dependencies.
- #
- # More info: https://docs.tilt.dev/local_resource.html
- #
- # local_resource('install-helm',
- # cmd='which helm > /dev/null || brew install helm',
- # # `cmd_bat`, when present, is used instead of `cmd` on Windows.
- # cmd_bat=[
- # 'powershell.exe',
- # '-Noninteractive',
- # '-Command',
- # '& {if (!(Get-Command helm -ErrorAction SilentlyContinue)) {scoop install helm}}'
- # ]
- # )
- # Extensions are open-source, pre-packaged functions that extend Tilt
- #
- # More info: https://github.com/tilt-dev/tilt-extensions
- #
- load('ext://git_resource', 'git_checkout')
- # Organize logic into functions
- # Tiltfiles are written in Starlark, a Python-inspired language, so
- # you can use functions, conditionals, loops, and more.
- #
- # More info: https://docs.tilt.dev/tiltfile_concepts.html
- #
- def tilt_demo():
- # Tilt provides many useful portable built-ins
- # https://docs.tilt.dev/api.html#modules.os.path.exists
- if os.path.exists('tilt-avatars/Tiltfile'):
- # It's possible to load other Tiltfiles to further organize
- # your logic in large projects
- # https://docs.tilt.dev/multiple_repos.html
- load_dynamic('tilt-avatars/Tiltfile')
- watch_file('tilt-avatars/Tiltfile')
- git_checkout('https://github.com/tilt-dev/tilt-avatars.git',
- checkout_dir='tilt-avatars')
- # Edit your Tiltfile without restarting Tilt
- # While running `tilt up`, Tilt watches the Tiltfile on disk and
- # automatically re-evaluates it on change.
- #
- # To see it in action, try uncommenting the following line with
- # Tilt running.
- # tilt_demo()
|