Skip to content

Commit 40d246e

Browse files
authored
Graylog: rolling config update (#1019)
Ensure graylog will be smoothly deployed when docker config content changes. Related Issue(s): * #984
1 parent 31c39e5 commit 40d246e

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

services/graylog/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker-compose.yml

services/graylog/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ up-local: .init .env ${TEMP_COMPOSE}-local ## Deploys graylog stack for local c
4848

4949
# Helpers -------------------------------------------------
5050

51+
docker-compose.yml: docker-compose.yml.j2 .venv .env
52+
@$(call jinja, $<, .env, $@)
53+
5154
.PHONY: ${TEMP_COMPOSE}
5255
${TEMP_COMPOSE}: docker-compose.yml ## Deploys stack
5356
# Hacky workaround introduced by DK2021 via https://github.com/docker/compose/issues/7771
@@ -87,6 +90,8 @@ ${TEMP_COMPOSE}-aws: docker-compose.yml docker-compose.aws.yml
8790
export GRAYLOG_ROOT_PASSWORD_SHA2;\
8891
GRAYLOG_PASSWORD_SECRET=$$(tr -dc A-Za-z0-9 </dev/urandom | head -c 16 ; echo '');\
8992
export GRAYLOG_PASSWORD_SECRET;\
93+
STACK_NAME=$(STACK_NAME); \
94+
export STACK_NAME; \
9095
set +o allexport; \
9196
envsubst < $< > $@
9297

services/graylog/docker-compose.yml renamed to services/graylog/docker-compose.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,5 @@ networks:
110110

111111
configs:
112112
graylog_config:
113+
name: ${STACK_NAME}_graylog_config_{{ "./data/contentpacks/osparc-custom-content-pack-v2.json" | sha256file | substring(0,10) }}
113114
file: ./data/contentpacks/osparc-custom-content-pack-v2.json

services/graylog/template.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
STACK_NAME=${STACK_NAME}
12
GRAYLOG_PASSWORD_SECRET=${GRAYLOG_PASSWORD_SECRET}
23
GRAYLOG_ROOT_PASSWORD_SHA2=${GRAYLOG_ROOT_PASSWORD_SHA2}
34
MONITORING_DOMAIN=${MONITORING_DOMAIN}

0 commit comments

Comments
 (0)