Skip to content

Commit 3e8de76

Browse files
authored
Merge pull request #10 from gleclaire/master
Replace inotify file watching with simplywatch
2 parents 6e97b28 + 29e1734 commit 3e8de76

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ MAINTAINER Pierre Besson https://github.com/PierreBesson
33

44
RUN apk --update add nodejs git openssh curl bash inotify-tools jq && \
55
rm -rf /var/cache/apk/* && \
6+
npm install -g simplywatch && \
67
npm install -g git2consul@0.12.12 && \
78
mkdir -p /etc/git2consul.d
89

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ services:
1616
- CONFIG_MODE=filesystem
1717
#- CONFIG_MODE=git
1818
- INIT_SLEEP_SECONDS=5
19+
- CONSUL_URL=consul

load-config.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ if [[ "$CONFIG_MODE" == "filesystem" ]]; then
3636
loadPropertiesFilesIntoConsul
3737

3838
# 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+
4341
fi
4442

4543
if [[ "$CONFIG_MODE" == "git" ]]; then

0 commit comments

Comments
 (0)