buildfoundation / mainframer

Tool for remote builds. Sync project to remote machine, execute command, sync back.
Apache License 2.0
1.73k stars 161 forks source link

Sync on file change #159

Open bazted opened 7 years ago

bazted commented 7 years ago

For some kinds of development like front-end, it is good to have possibility to sync files on each change. As far as I know rsync provides such functionality. I think it will be great to have specific configurations for file watcher.

artem-zinnatullin commented 7 years ago

Yup, many build systems support such continuation modes, we can try to play with it. I have two concerns at the moment though:

ntziolis commented 6 years ago

Any update on this? This would significantly add usefulness to mainframer as many tools especially on the frondend provide continuous build.

artem-zinnatullin commented 6 years ago

No updates so far, there is an unfortunate conflict between Mainframer being continuous and a build tool being continuous

Mainframer doesn't just sync your files, it also executes a command. It's unclear how should one run both and have proper execution updates

You can obviously run separate Mainframer or ssh with continous build command and then run something like mainframer --continuous true just to get continuous file sync, but that doesn't feel right

ntziolis commented 6 years ago

Thank you for that! If that does continuous forth and back of provided directories than that solves our use case. Can you confirm it does both ways continous?

The toolchains that support continuous build have to deal with wrong partials all the time hence i think file sync should be just fine and we can live with the extra step of starting the build service.

artem-zinnatullin commented 6 years ago

Wait wait, we don't have continuous execution mode in Mainframer yet.

Let's call it --continuous-execution for now. It'll basically be running mainframer remote-command periodically/on-file change which is very different from remote-command being continuous itself

We're thinking about --continuous-execution and if we decide to go with it it'll conflict with continuous commands.

There is also an unfortunate conflict in naming with continuous file sync during execution that we're adding in 3.x (basically syncs files in parallel to the command to save time).

febs commented 5 years ago

Well, if the synchronization of files would happen continuously then when it's build time most of the files would have been synced already, thus making the whole process even faster.

lukaville commented 5 years ago

@febs but uploading is not a problem in most cases because developers usually make small changes in the source code and it syncs almost immediately. I think the main benefit here is that we can "pre-build" these changes remotely.

artem-zinnatullin commented 5 years ago

Correct.

We are also thinking about using inotify/fswatch to optimize sync for large projects, that will reduce time it takes rsync to understand what's changed.