core
core copied to clipboard
File System Watcher
Parent Issue
https://github.com/dotCMS/core/issues/28378
Task
We need some sort of tool to monitor file systems for changes, and trigger a push when a change is detected.
The idea is to include a new parameter --watch
to the existing push commands (the global push and the specific ones).
After a brainstorming session, we agreed the following:
- Use Java nio watch service where possible to be notified of changes rather than polling and scanning the folder every time. The watch service only works if the OS supports it and on linux does not work on separate disk, so the code should fallback to polling if the Watch Service is not available.
- When a new notification is received, we should wait 2 seconds by default before running the push logic to make sure there are no further changes over a minimum time. This would prevent the case where there are logs of changes and we end up having to run the sync multiple times where it could be covered with the once if we waited for a few seconds. The waiting time can be set using a parameter as well, and if not defined, it will default to 2 secs.
- No explicit path will be provided, the service will use the same path being used by the push command (it includes the case when the --workspace is set)
Proposed Objective
Same as Parent Issue
Proposed Priority
Same as Parent Issue
Acceptance Criteria
Essentially we're aiming for automated deployment capabilities using the CLI.
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response