mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Switch to 'make' for running app processes
These are simple enough that they don't need their own scripts.
This commit is contained in:
18
Makefile
18
Makefile
@@ -21,6 +21,24 @@ NOTIFY_CREDENTIALS ?= ~/.notify-credentials
|
|||||||
|
|
||||||
## DEVELOPMENT
|
## 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
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|||||||
@@ -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.
|
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:
|
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
|
## To test the application
|
||||||
|
|
||||||
First, ensure that `scripts/bootstrap.sh` has been run, as it creates the test database.
|
First, ensure that `scripts/bootstrap.sh` has been run, as it creates the test database.
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
source environment.sh
|
|
||||||
flask run -p 6011
|
|
||||||
@@ -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
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
source environment.sh
|
|
||||||
celery -A run_celery.notify_celery beat --loglevel=INFO
|
|
||||||
Reference in New Issue
Block a user