File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ MAINTAINER Pierre Besson https://github.com/PierreBesson
3
3
4
4
RUN apk --update add nodejs git openssh curl bash inotify-tools jq && \
5
5
rm -rf /var/cache/apk/* && \
6
+ npm install -g simplywatch && \
6
7
npm install -g git2consul@0.12.12 && \
7
8
mkdir -p /etc/git2consul.d
8
9
Original file line number Diff line number Diff line change @@ -16,3 +16,4 @@ services:
16
16
- CONFIG_MODE=filesystem
17
17
# - CONFIG_MODE=git
18
18
- INIT_SLEEP_SECONDS=5
19
+ - CONSUL_URL=consul
Original file line number Diff line number Diff line change @@ -36,10 +36,8 @@ if [[ "$CONFIG_MODE" == "filesystem" ]]; then
36
36
loadPropertiesFilesIntoConsul
37
37
38
38
# Reload the files when there is a file change
39
- inotifywait -q -m --format ' %f' -e close_write $CONFIG_DIR / | while read
40
- do
41
- loadPropertiesFilesIntoConsul
42
- done
39
+ simplywatch -g " $CONFIG_DIR /**" -x " curl --output /dev/null -sX PUT --data-binary @{{path}} http://$CONSUL_URL :$CONSUL_PORT /v1/kv/config/{{name}}/data && echo ' Consul Config reloaded'"
40
+
43
41
fi
44
42
45
43
if [[ " $CONFIG_MODE " == " git" ]]; then
You can’t perform that action at this time.
0 commit comments