frigate/Makefile

56 lines
1.6 KiB
Makefile
Raw Normal View History

default_target: local
2020-10-08 00:25:54 +03:00
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
2024-08-06 15:39:58 +03:00
VERSION = 0.15.0
IMAGE_REPO ?= ghcr.io/blakeblackshear/frigate
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
BOARDS= #Initialized empty
include docker/*/*.mk
build-boards: $(BOARDS:%=build-%)
push-boards: $(BOARDS:%=push-%)
2020-12-19 15:51:10 +03:00
version:
echo 'VERSION = "$(VERSION)-$(COMMIT_HASH)"' > frigate/version.py
local: version
2024-09-16 15:35:26 +03:00
docker buildx build --target=frigate --file docker/main/Dockerfile . \
--tag frigate:latest \
--load
2021-05-18 08:52:08 +03:00
amd64:
2024-09-16 15:35:26 +03:00
docker buildx build --target=frigate --file docker/main/Dockerfile . \
--tag $(IMAGE_REPO):$(VERSION)-$(COMMIT_HASH) \
--platform linux/amd64
arm64:
2024-09-16 15:35:26 +03:00
docker buildx build --target=frigate --file docker/main/Dockerfile . \
--tag $(IMAGE_REPO):$(VERSION)-$(COMMIT_HASH) \
--platform linux/arm64
build: version amd64 arm64
2024-09-16 15:35:26 +03:00
docker buildx build --target=frigate --file docker/main/Dockerfile . \
--tag $(IMAGE_REPO):$(VERSION)-$(COMMIT_HASH) \
--platform linux/arm64/v8,linux/amd64
push: push-boards
2024-09-16 15:35:26 +03:00
docker buildx build --target=frigate --file docker/main/Dockerfile . \
--tag $(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH) \
--platform linux/arm64/v8,linux/amd64 \
--push
2021-01-09 20:26:46 +03:00
run: local
docker run --rm --publish=5000:5000 --volume=${PWD}/config:/config frigate:latest
run_tests: local
2024-09-16 15:35:26 +03:00
docker run --rm --workdir=/opt/frigate --entrypoint= frigate:latest \
python3 -u -m unittest
docker run --rm --workdir=/opt/frigate --entrypoint= frigate:latest \
python3 -u -m mypy --config-file frigate/mypy.ini frigate
2022-03-11 07:33:53 +03:00
.PHONY: run_tests