-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (48 loc) · 1.83 KB
/
Makefile
File metadata and controls
59 lines (48 loc) · 1.83 KB
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
SHELL=/bin/bash
REGISTRY_NAME?=kantale
VERSION=$(shell cat app/views.py | grep "^__version__ =" | cut -d\' -f2)
IMAGE_TAG=$(REGISTRY_NAME)/openbio:$(VERSION)
CHART_DIR=./chart/openbio
.PHONY: all deploy-local undeploy-local develop container container-push release
all: container
deploy-local:
# Create directory for database
mkdir -p psql
helm list -q | grep openbio || \
helm install openbio $(CHART_DIR) --namespace default \
--set image="$(IMAGE_TAG)" \
--set openbio.databaseHostPath="$(PWD)/psql" \
--set openbio.djangoSecret='!!!!!!!!!!!!!!!thisisasecretkey!!!!!!!!!!!!!!!!' \
--set openbio.djangoDebug="1" \
--set openbio.title="OpenBio test" \
--set openbio.serverURL="http://127.0.0.1:8200" \
--set openbio.fromEmail="test@example.com" \
--set openbio.adminEmail="admin@example.com" \
--set openbio.termsURL="" \
--set openbio.privacyURL="" \
--set openbio.showFundingLogos="false" \
--set openbio.serviceType="LoadBalancer"
undeploy-local:
helm uninstall openbio --namespace default
develop:
# Install npm dependencies
npm install --prefix app/static/app
npm run get-material-icons --prefix app/static/app
npm run fix-ace --prefix app/static/app
# Create the Python environment and prepare the application
if [[ ! -d venv ]]; then python3 -m venv venv; fi
if [[ -z "$${VIRTUAL_ENV}" ]]; then \
source venv/bin/activate; \
pip install -r requirements.txt; \
python manage.py migrate --run-syncdb; \
python manage.py runserver 0.0.0.0:8200; \
fi
# python manage.py createsuperuser
container:
docker build -f Dockerfile --build-arg TARGETARCH=arm64 -t $(IMAGE_TAG) .
container-push:
docker buildx build --platform linux/amd64,linux/arm64 --push -f Dockerfile -t $(IMAGE_TAG) .
release:
if git tag -l | grep "^v${VERSION}$$"; then echo "Version ${VERSION} already tagged"; exit 1; fi
git tag v${VERSION}
# git push --tags