Skip to content

Commit 2276409

Browse files
committed
Add missing makefile scripts
1 parent 28eddca commit 2276409

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

Makefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,50 @@ stack-rm: ## Local Stack: Remove Services and Volumes
182182
@echo "Remove local volume data"
183183
@docker volume rm $(PROJECT_NAME)_vol-site-data
184184

185+
186+
###########################################
187+
# SOLR
188+
###########################################
189+
190+
BACKEND_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
191+
192+
SOLR_DATA_FOLDER?=${BACKEND_FOLDER}/data
193+
SOLR_ONLY_COMPOSE?=${BACKEND_FOLDER}/docker-compose.yml
194+
195+
## Solr docker utils
196+
test-compose-project-name:
197+
# The COMPOSE_PROJECT_NAME env variable must exist and discriminate between your projects,
198+
# and the purpose of the container (_DEV, _STACK, _TEST)
199+
test -n "$(PROJECT_NAME)"
200+
201+
.PHONY: solr-start
202+
solr-start: test-compose-project-name ## Start solr
203+
@echo "Start solr"
204+
@COMPOSE_PROJECT_NAME=${PROJECT_NAME} docker compose -f ${STACK_FILE} up -d solr
205+
206+
.PHONY: solr-start-fg
207+
solr-start-fg: test-compose-project-name ## Start solr in foreground
208+
@echo "Start solr in foreground"
209+
@COMPOSE_PROJECT_NAME=${PROJECT_NAME} docker compose -f ${STACK_FILE} up solr
210+
211+
.PHONY: solr-stop
212+
solr-stop: test-compose-project-name ## Stop solr
213+
@echo "Stop solr"
214+
@COMPOSE_PROJECT_NAME=${PROJECT_NAME} docker compose -f ${STACK_FILE} down solr
215+
216+
.PHONY: solr-logs
217+
solr-logs: test-compose-project-name ## Show solr logs
218+
@echo "Show solr logs"
219+
@COMPOSE_PROJECT_NAME=${PROJECT_NAME} docker compose -f ${STACK_FILE} logs -f solr
220+
221+
.PHONY: solr-activate-and-reindex
222+
solr-activate-and-reindex: ## Activate solr and reindex content
223+
$(MAKE) -C "./backend/" solr-activate-and-reindex
224+
225+
.PHONY: solr-activate-and-reindex-clear
226+
solr-activate-and-reindex-clear: ## Activate solr and reindex content with clear
227+
$(MAKE) -C "./backend/" solr-activate-and-reindex-clear
228+
185229
###########################################
186230
# Acceptance
187231
###########################################

backend/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ console: $(VENV_FOLDER) instance/etc/zope.ini ## Start a console into a Plone in
9494
create-site: $(VENV_FOLDER) instance/etc/zope.ini ## Create a new site from scratch
9595
@$(BIN_FOLDER)/zconsole run instance/etc/zope.conf ./scripts/create_site.py
9696

97+
.PHONY: solr-activate-and-reindex
98+
solr-activate-and-reindex: $(VENV_FOLDER) instance/etc/zope.ini ## Activate solr and reindex content
99+
PYTHONWARNINGS=ignore @$(BIN_FOLDER)/zconsole run instance/etc/zope.conf ./scripts/solr_activate_and_reindex.py
100+
101+
.PHONY: solr-activate-and-reindex-clear
102+
solr-activate-and-reindex-clear: $(VENV_FOLDER) instance/etc/zope.ini ## Activate solr and reindex content with clear
103+
PYTHONWARNINGS=ignore @$(BIN_FOLDER)/zconsole run instance/etc/zope.conf ./scripts/solr_activate_and_reindex.py --clear
104+
97105
# Example Content
98106
.PHONY: update-example-content
99107
update-example-content: $(VENV_FOLDER) ## Export example content inside package

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,5 @@ services:
108108
- plone
109109
- /plone-config
110110

111-
112111
volumes:
113112
vol-site-data: {}

0 commit comments

Comments
 (0)