-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
89 lines (70 loc) · 2.75 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.PHONY: clean docker test run-docker run build-docker-demo
UID=$(shell id -u)
GID=$(shell id -g)
ifeq ($(TARGET_ARCH),)
ARCH=$(shell uname -m)
PLATFORM_STR =
else
ARCH = $(TARGET_ARCH)
PLATFORM_STR = --platform linux/$(TARGET_ARCH)
endif
default:
@echo "Make target 'debian-docker' explicitly."
clean-debian:
rm -rf dist_deb
debian-docker:
for plat in arm64 amd64; do \
cd server; TARGET_ARCH=$$plat make debian-docker; cd ..; \
cd organizer; TARGET_ARCH=$$plat make debian-docker; cd ..; \
done
(cd client; make debian-docker)
mkdir -p dist_deb
cp client/dist_deb/* dist_deb/
cp server/dist_deb/* dist_deb/
cp organizer/basic_folders/dist_deb/* dist_deb/
rm dist_deb/*dbgsym*
ls -l dist_deb/
clean: clean-debian
(cd client; make clean)
(cd server; make clean)
(cd organizer; make clean)
(cd protobuf; make clean)
docker:
(cd client; make docker)
(cd server; make docker)
(cd organizer; make docker)
test:
(cd client; make test-docker)
(cd server; make test-docker)
run-docker: debian-docker
DOCKER_BUILDKIT=1 docker build -t clapshot-comb --build-arg UID=${UID} --build-arg GID=${GID} --pull -f Dockerfile.demo .
# Add a simple test video to incoming already
mkdir -p test/VOLUME/data/incoming
cp server/src/tests/assets/60fps-example.mp4 test/VOLUME/data/incoming/
docker run --rm -it -p 0.0.0.0:8080:80 --mount type=bind,source="$$(pwd)"/test/VOLUME,target=/mnt/clapshot-data clapshot-comb
build-docker-demo: debian-docker
@which jq || (echo "ERROR: Please install jq first." && exit 1)
$(eval PVER=$(shell jq -r '.version' client/package.json))
DOCKER_BUILDKIT=1 docker build --platform linux/amd64,linux/arm64 --pull \
-t clapshot:${PVER}-demo \
-t elonen/clapshot:${PVER}-demo \
-t elonen/clapshot:latest-demo \
--build-arg UID=1002 --build-arg GID=1002 -f Dockerfile.demo .
DOCKER_BUILDKIT=1 docker build --platform linux/amd64,linux/arm64 --pull \
-t clapshot:${PVER}-demo-htadmin \
-t elonen/clapshot:${PVER}-demo-htadmin \
-t elonen/clapshot:latest-demo-htadmin \
--build-arg UID=1002 --build-arg GID=1002 -f Dockerfile.demo . --build-arg auth_variation=htadmin
build-docker-demo-and-push-hub: debian-docker
@which jq || (echo "ERROR: Please install jq first." && exit 1)
$(eval PVER=$(shell jq -r '.version' client/package.json))
DOCKER_BUILDKIT=1 docker build --platform linux/amd64,linux/arm64 --pull \
-t elonen/clapshot:${PVER}-demo \
-t elonen/clapshot:latest-demo \
--build-arg UID=1002 --build-arg GID=1002 -f Dockerfile.demo \
--push .
DOCKER_BUILDKIT=1 docker build --platform linux/amd64,linux/arm64 --pull \
-t elonen/clapshot:${PVER}-demo-htadmin \
-t elonen/clapshot:latest-demo-htadmin \
--build-arg UID=1002 --build-arg GID=1002 -f Dockerfile.demo --build-arg auth_variation=htadmin \
--push .