Skip to content

Commit

Permalink
Add start-redis-support and worker command to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
maethu committed Nov 10, 2022
1 parent 3e19447 commit 0db34f2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ REDIS_CONTAINER=redistest
ELASTIC_SEARCH_CONTAINERS=$$(docker ps -q -a -f "name=${ELASTIC_SEARCH_CONTAINER}" | wc -l)
REDIS_CONTAINERS=$$(docker ps -q -a -f "name=${REDIS_CONTAINER}" | wc -l)

# Default env for elasticsearch with redis queue
DEFAULT_ENV_ES_REDIS=PLONE_REDIS_DSN=redis://localhost:6379/0 \
PLONE_BACKEND=http://localhost:8080/Plone \
PLONE_USERNAME=admin \
PLONE_PASSWORD=admin

ifndef LOG_LEVEL
LOG_LEVEL=INFO
endif
Expand Down Expand Up @@ -194,3 +200,15 @@ start: ## Start a Plone instance on localhost:8080
.PHONY: populate
populate: ## Populate site with wikipedia content
PYTHONWARNINGS=ignore ./bin/zconsole run etc/zope.conf scripts/populate.py

.PHONY: start-redis-support
start-redis-support: ## Start a Plone instance on localhost:8080
@echo "$(GREEN)==> Set env variables, PLONE_REDIS_DSN, PLONE_BACKEND, PLONE_USERNAME and PLONE_PASSWORD before start instance$(RESET)"
PYTHONWARNINGS=ignore \
$(DEFAULT_ENV_ES_REDIS) \
./bin/runwsgi instance/etc/zope.ini


.PHONY: worker
worker: ## Start a worker for the redis queue
$(DEFAULT_ENV_ES_REDIS) ./bin/rq worker normal low --with-scheduler

0 comments on commit 0db34f2

Please sign in to comment.