-
Notifications
You must be signed in to change notification settings - Fork 11
/
makefile
72 lines (54 loc) · 2.37 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.PHONY: release venv
# used for tagging our docker images
TAG ?= $(shell echo $$APP_RELEASE)-$(shell git log -n 1 --format=%h)
# Create Python virtual environment if not yet created.
venv:
test -d .venv || python -m venv .venv
## Installing
release:
dotenv -f env.prod run -- sentry-cli releases new -p admin-portal $(shell sentry-cli releases propose-version)
dotenv -f env.prod run -- sentry-cli releases set-commits --auto $(shell sentry-cli releases propose-version)
dotenv -f env.prod run -- ansible-playbook ansible/deploy.yml -i ansible/inventories/prod.yml
dotenv -f env.prod run -- sentry-cli releases finalize $(shell sentry-cli releases propose-version)
dev.createsuperuser:
dotenv run -- python ./manage.py createsuperuser --username admin --email admin@admin.commits --noinput
dotenv run -- python ./manage.py set_fake_passwords
dev.runserver:
dotenv run -- python manage.py runserver
# start the tailwind watcher
dev.tailwind.start:
dotenv run -- python manage.py tailwind start
# install the front end dependencies
dev.tailwind.install:
dotenv run -- python manage.py tailwind install
dev.test:
dotenv run -- pytest -s --create-db --looponfail --ds=greenweb.settings.testing
dev.test.only:
dotenv run -- pytest -s --create-db --looponfail -m only -v --ds=greenweb.settings.testing
data_analysis_repo:
if test -d data-analysis; \
then echo "data-analysis repo already checked out"; \
else git clone https://github.com/thegreenwebfoundation/data-analysis.git; \
fi
# start a marimo notebook session
notebook.gitpod: data_analysis_repo
# set up our start notebook with django initialised ready for queries
dotenv run -- marimo edit data-analysis/starter-notebook.py
# Run a basic test(with pytest) that creates a database using the testing settings
test:
dotenv run -- pytest -s --create-db --ds=greenweb.settings.testing
test.only:
dotenv run -- pytest -s --create-db -m only -v --ds=greenweb.settings.testing
# Build the documentation using Sphinx
docs:
dotenv run -- sphinx-build ./docs _build/
# Build the documentation using Sphinx and keep updating it on every change
docs.watch:
dotenv run -- sphinx-autobuild ./docs _build/
# make a docker image for publishing to our registry
docker.build:
docker build -t $(APP_NAME)
# Push the current
docker.release:
docker tag $(APP_NAME) $(DOCKER_REGISTRY):$(TAG)
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(TAG)