-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (46 loc) · 1.46 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
CURRENT_VERSION=$(shell cat project/__init__.py | cut -d "'" -f 2)
DOCKER_IMAGE_NAME=dataesr/affiliation-matcher
GHCR_IMAGE_NAME=ghcr.io/$(DOCKER_IMAGE_NAME)
test: unit
unit: start
@echo Running unit tests...
APP_ENV=test venv/bin/python -m pytest
@echo End of unit tests
start: stop
@echo Affiliation matcher starting...
docker compose up -d
@echo Affiliation matcher started http://localhost:5004
stop:
@echo Affiliation matcher stopping...
docker compose down
@echo Affiliation matcher stopped
install:
@echo Installing dependencies...
pip install -r requirements.txt
@echo End of dependencies installation
client-build:
@echo Building client files
cd project/client && npm install && npm run build
docker-build:
@echo Building a new docker image
docker build -t $(GHCR_IMAGE_NAME):$(CURRENT_VERSION) -t $(GHCR_IMAGE_NAME):latest .
@echo Docker image built
docker-push:
@echo Pushing a new docker image
docker push -a $(GHCR_IMAGE_NAME)
@echo Docker image pushed
python-build:
@echo Building a python package
venv/bin/python setup.py sdist
@echo Python package built
load:
@echo Load all data into ES
curl http://localhost:5004/load
@echo Affiliation matcher is now populated
release:
echo "__version__ = '$(VERSION)'" > project/__init__.py
cd project/client && npm version $(VERSION)
make client-build
git commit -am '[release] version $(VERSION)'
git tag $(VERSION)
@echo If everything is OK, you can push with tags i.e. git push origin master --tags