-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (25 loc) · 889 Bytes
/
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
DOCKER_IMAGE_NAME=ghcr.io/dataesr/harvest-patstat
CURRENT_VERSION=$(shell cat application/__init__.py | cut -d "'" -f 2)
test: unit
unit:
@echo Running unit tests...
python3 -m pytest
@echo End of unit tests
install:
@echo Installing dependencies...
pip install -r requirements.txt
@echo End of dependencies installation
docker-build:
@echo Building a new docker image
docker build -t $(DOCKER_IMAGE_NAME):$(CURRENT_VERSION) -t $(DOCKER_IMAGE_NAME):latest .
@echo Docker image built
docker-push:
@echo Pushing a new docker image
docker push $(DOCKER_IMAGE_NAME):$(CURRENT_VERSION)
docker push $(DOCKER_IMAGE_NAME):latest
@echo Docker image pushed
release:
echo "__version__ = '$(VERSION)'" > application/__init__.py
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