-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (64 loc) · 2.37 KB
/
Makefile
File metadata and controls
81 lines (64 loc) · 2.37 KB
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
IMAGE_NAME=mediaflow
IMAGE_TAG=latest
IMAGE_REPO=docker.io/syntaxsdev
IMAGE_FULL_NAME=$(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
# ARCH := $(shell uname -m)
run: build
@echo "Starting server 🚀"
@set -a && . ./.env && ./mediaflow
run-air:
@echo "Starting server with air 🚀"
@set -a && . ./.env && air
run-air-local:
@echo "Starting server with air 🚀"
@set -a && . ./.env.local && air
build:
@echo "Building server 🔨"
@go build -o mediaflow main.go
@echo "Server built successfully 🎉"
setup-buildx:
@echo "Setting up multiplatform builder 🔧"
@./scripts/setup-buildx.sh
check-buildx:
@echo "Checking buildx builder status 🔍"
@./scripts/check-buildx.sh
stop-buildx:
@echo "Stopping buildx builder 🛑"
@./scripts/stop-buildx.sh
build-image: setup-buildx
@echo "Building image for AMD64 and 386 🔨"
@docker buildx build --platform linux/amd64,linux/386 -t $(IMAGE_FULL_NAME) --load .
@echo "Image built successfully 🎉"
build-image-arm64: setup-buildx
@echo "Building image for ARM64 🔨"
@DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 --builder default --load -t $(IMAGE_FULL_NAME) -f Dockerfile .
@echo "ARM64 image built successfully 🎉"
build-image-all: setup-buildx
@echo "Building image for all supported platforms 🔨"
@docker buildx build --platform linux/amd64,linux/386 -t $(IMAGE_FULL_NAME) .
@echo "Multi-platform image built successfully 🎉"
@echo "Note: Multi-platform images are not loaded locally. Use --push to push to registry."
push-image: setup-buildx
@echo "Building and pushing multi-platform image 🔨"
@docker buildx build --platform linux/amd64,linux/386 -t $(IMAGE_FULL_NAME) --push .
@echo "Multi-platform image built and pushed successfully 🎉"
run-image:
@echo "Running image 🚀"
@set -a && . ./.env && docker run -p 8080:8080 --replace -n mediaflow-server --rm $(IMAGE_FULL_NAME)
test:
@echo "Running tests 🧪"
@go test -v ./internal/...
test-coverage:
@echo "Running tests with coverage 📊"
@go test -v -coverprofile=coverage.out ./internal/...
@go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
test-upload:
@echo "Running upload module tests 🔄"
@go test -v ./internal/upload
test-auth:
@echo "Running auth module tests 🔐"
@go test -v ./internal/auth
clean:
@echo "Cleaning up 🧹"
@rm -f mediaflow coverage.out coverage.html