tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.68k stars 302 forks source link

Triggers should support file globs #1818

Open jazzdan opened 5 years ago

jazzdan commented 5 years ago

Triggers should allow you to specify file globs, not just a list of files. For example:

docker_build('laravel-app', 'laravel-app',
  live_update=[
    sync('laravel-app/src', '/var/www'),
    sync('laravel-app/web', '/var/www/public'),
    run('cd /var/www/public && yarn build', trigger='laravel-app/web/*.js'),
    restart_container(),
  ]
)

In this case we have an app written in two languages: PHP and JavaScript. We want to build the minified/optimized JS but only if the JS has changed.

This isn't solved by context filters (ignore/only) because this is all one image.

maiamcc commented 4 years ago

Closing in favor of #2815, which is a more holistic feature request.

nicks commented 3 years ago

I'm going to reopen this as a separate ticket.

I understand the impulse to say "all globs should have the same implementation." But in real build systems, supporting globs in different places often leads to radical differences in performance that need to be carefully optimized away

nicks commented 3 years ago

adding this use-case from https://github.com/tilt-dev/tilt/issues/4347:

For example, I use graphql files to specify a schema, and there's a simple build step for copying files into the build directory. When I update a typescript file, it copies the graphql files even though there was no .{gql,graphql} change.

bigkraig commented 2 years ago
image

Did this somehow slip past the roadmap? I'm looking forward to this as a way to only trigger restarts on my .js output files after a .ts build completes.