Closed sonOfRa closed 4 years ago
This repository only handles the Wiremock Docker image build and deployment based on the official Wiremock product.
If you want to suggest a new feature on it, you may do it on the official repository. Although, an issue has already been opened : https://github.com/tomakehurst/wiremock/issues/1243
Yeah, I'm aware this is "only" the docker image. I opened the issue here because I figured it would be useful in the context of the docker image, even if upstream does not have a hot reloading feature.
I understand your need but I want to stay coherent with the official repository
Wiremock itself doesn't contain functionality to automatically reload mappings if they change on the file system.
However, there is an endpoint POST __admin/mappings/reset to reload mappings on demand.
This could be used in two ways to trigger reloading:
1) Run a shell script with a configurable refresh interval that POSTs to that endpoint 2) Run an inotify-check shell script that fires a POST to that endpoint whenever the mappings folder changes.
Our use case for this is that we are using the container in a local dev environment, and the mappings folder is a bind mount into the container. Would you be interested in either of those possibilities being included in the docker images (would require to install inotify-tools and curl, or just curl if the interval method is used).
Currently, we just launch an additional container in our compose file that hits the endpoint every few seconds: