Skaffold: Support post-sync hooks

Created on 22 Nov 2018  路  10Comments  路  Source: GoogleContainerTools/skaffold

When a local file is synced into a running container, it would be useful to run a command inside the container., either to tell the running process to reload that file or to perform some post-processing such as minification.

arehooks aresync kinfeature-request prioritp0

Most helpful comment

@mark-ambrazhevich-spiral and everyone else here, just a quick update that this is now being prioritized by our team. we'll provide updates as we make progress!

All 10 comments

Maybe close in favor of #1441 ?

@nthypes I don't think it's quite the same issue. this one refers to running a hook inside the container that the files were synced to - that issue is around running commands on the host that skaffold is running on.

@nthypes I don't think it's quite the same issue. this one refers to running a hook inside the container that the files were synced to - that issue is around running commands on the host that skaffold is running on.

Gotcha!

Not sure about any milestone set for this. My use case as well requires a command to be executed within my container after sync has been performed.

If post-sync hooks are allowed, will the hook be called a single time or multiple times for each file change ? I believe, all changes at a given time are tar'ed and copied in one go into the container.

sync:
  infer:
  - 'workdir/compiled/packages/foo'
       command: [ 1. Reload config, 2. Ensure reloaded config ]
  - 'workdir/**/*'

Note that, I would like to run commands only when my 'config.json' file is synced and not when rest of the files from the same directory are synced (to avoid reload multiple times).

Similar to https://github.com/GoogleContainerTools/skaffold/pull/1627#issuecomment-462162544

@loosebazooka This could be addressed in #2357. adding same priority as #2357
Can we close this as dupe if it something we could implement as #2357

We also reallly would like to see this feature. Our use cases is once files get updated, we need to issue command to gracefully reload application.

@mark-ambrazhevich-spiral and everyone else here, just a quick update that this is now being prioritized by our team. we'll provide updates as we make progress!

Any update? The priority on this seems unusually high compared to the progress seen here so far.

the design for this is being actively worked on. I think it's fine to leave this as P1

Closing in favour of more generic #1441

Was this page helpful?
0 / 5 - 0 ratings