Skip to content

Commit

Permalink
Merge pull request #10 from gleclaire/master
Browse files Browse the repository at this point in the history
Replace inotify file watching with simplywatch
  • Loading branch information
PierreBesson authored Apr 24, 2017
2 parents 6e97b28 + 29e1734 commit 3e8de76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MAINTAINER Pierre Besson https://github.com/PierreBesson

RUN apk --update add nodejs git openssh curl bash inotify-tools jq && \
rm -rf /var/cache/apk/* && \
npm install -g simplywatch && \
npm install -g [email protected] && \
mkdir -p /etc/git2consul.d

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ services:
- CONFIG_MODE=filesystem
#- CONFIG_MODE=git
- INIT_SLEEP_SECONDS=5
- CONSUL_URL=consul
6 changes: 2 additions & 4 deletions load-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ if [[ "$CONFIG_MODE" == "filesystem" ]]; then
loadPropertiesFilesIntoConsul

# Reload the files when there is a file change
inotifywait -q -m --format '%f' -e close_write $CONFIG_DIR/ | while read
do
loadPropertiesFilesIntoConsul
done
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'"

fi

if [[ "$CONFIG_MODE" == "git" ]]; then
Expand Down

0 comments on commit 3e8de76

Please sign in to comment.