File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,24 @@ STACK_NAME = $(notdir $(shell pwd))
77TEMP_COMPOSE =.stack.${STACK_NAME}.yaml
88REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
99
10+ define create-s3-bucket
11+ # ensure bucket is available in S3...
12+ set -o allexport; \
13+ source .env; \
14+ echo Creating bucket "$${S3_BUCKET_NAME_LOKI}";\
15+ export S3_ACCESS_KEY=$${S3_ACCESS_KEY_LOKI}; \
16+ export S3_SECRET_KEY=$${S3_SECRET_KEY_LOKI}; \
17+ export STORAGE_DOMAIN=$${STORAGE_DOMAIN}; \
18+ ${REPO_BASE_DIR}/scripts/create-s3-bucket.bash "$${S3_BUCKET_NAME_LOKI}" && \
19+ set +o allexport; \
20+ # bucket is available in S3
21+ endef
22+
1023# TARGETS --------------------------------------------------
1124include ${REPO_BASE_DIR}/scripts/common.Makefile
1225
1326.PHONY : up
14- up : .init .env ${TEMP_COMPOSE} # # Deploys graylog stack
27+ up : .init .env ${TEMP_COMPOSE} # # Deploys logging stack
1528 @docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE} ${STACK_NAME}
1629 $(MAKE ) configure
1730
@@ -43,6 +56,7 @@ up-master: .init .env ${TEMP_COMPOSE}-master
4356
4457.PHONY : up-local # # Deploys graylog stack for local deployment
4558up-local : .init .env ${TEMP_COMPOSE}-local # # Deploys graylog stack for local cluster
59+ @$(create-s3-bucket )
4660 @docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE} -local ${STACK_NAME}
4761 $(MAKE ) configure
4862
Original file line number Diff line number Diff line change @@ -23,3 +23,4 @@ S3_BUCKET_NAME_LOKI=${S3_BUCKET_NAME_LOKI}
2323S3_FORCE_PATH_STYLE_LOKI = ${ S3_FORCE_PATH_STYLE_LOKI }
2424S3_REGION_LOKI = ${ S3_REGION_LOKI }
2525S3_SECRET_KEY_LOKI = ${ S3_SECRET_KEY_LOKI }
26+ STORAGE_DOMAIN = ${ STORAGE_DOMAIN }
You can’t perform that action at this time.
0 commit comments