Switch to 'make' for running app processes

These are simple enough that they don't need their own scripts.
This commit is contained in:
Ben Thorner
2021-02-17 16:49:05 +00:00
parent 4c0aea50ae
commit ba4d399982
5 changed files with 21 additions and 22 deletions

View File

@@ -21,6 +21,24 @@ NOTIFY_CREDENTIALS ?= ~/.notify-credentials
## DEVELOPMENT
.PHONY: run-flask
run-flask:
. environment.sh && flask run -p 6011
.PHONY: run-celery
run-celery:
. environment.sh && celery \
-A run_celery.notify_celery worker \
--pidfile="/tmp/celery.pid" \
--loglevel=INFO \
--concurrency=4
.PHONY: run-celery-beat
run-celery-beat:
. environment.sh && celery \
-A run_celery.notify_celery beat \
--loglevel=INFO
.PHONY: help
help:
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

View File

@@ -71,20 +71,19 @@ You need to run the api application and a local celery instance.
There are two run scripts for running all the necessary parts.
```
scripts/run_app.sh
make run-flask
```
```
scripts/run_celery.sh
make run-celery
```
Optionally you can also run this script to run the scheduled tasks:
```
scripts/run_celery_beat.sh
make run-celery-beat
```
## To test the application
First, ensure that `scripts/bootstrap.sh` has been run, as it creates the test database.

View File

@@ -1,6 +0,0 @@
#!/bin/bash
set -e
source environment.sh
flask run -p 6011

View File

@@ -1,6 +0,0 @@
#!/bin/bash
set -e
source environment.sh
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=4

View File

@@ -1,6 +0,0 @@
#!/bin/bash
set -e
source environment.sh
celery -A run_celery.notify_celery beat --loglevel=INFO