-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (33 loc) · 1.24 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
CURRENT_VERSION=$(shell cat bso/__init__.py | cut -d "'" -f 2)
DOCKER_IMAGE_NAME=dataesr/bso-publications
GHCR_IMAGE_NAME=ghcr.io/$(DOCKER_IMAGE_NAME)
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 $(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
release:
echo "__version__ = '$(VERSION)'" > bso/__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 main --tags
release-scanr:
echo "__version__ = '$(CURRENT_VERSION)-scanr'" > bso/__init__.py
@echo Building scanr image $(CURRENT_VERSION)-scanr
docker build -t $(GHCR_IMAGE_NAME):$(CURRENT_VERSION)-scanr -t $(GHCR_IMAGE_NAME):latest .
@echo Pushing scanr image $(CURRENT_VERSION)-scanr
docker push -a $(GHCR_IMAGE_NAME)
@echo $(CURRENT_VERSION)-scanr image pushed
echo "__version__ = '$(CURRENT_VERSION)'" > bso/__init__.py