Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) · 1.5 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
BINARY := magnetowid
VERSION ?= dev
LDFLAGS := -s -w -X main.version=$(VERSION)
.PHONY: build test docker-smoke package-smoke integration live snapshot clean
build:
go build -ldflags '$(LDFLAGS)' -o $(BINARY) ./cmd/magnetowid
test:
@unformatted="$$(gofmt -l .)"; if [ -n "$$unformatted" ]; then echo "gofmt needed:"; echo "$$unformatted"; exit 1; fi
go vet ./...
go test -race ./...
# Bypass the test cache when the image may have changed.
docker-smoke:
docker build --build-arg VERSION=$(VERSION) -t $(BINARY):smoke .
MAGNETOWID_SMOKE_IMAGE=$(BINARY):smoke go test -count=1 -run TestContainerServesAPIs ./cmd/magnetowid
package-smoke:
goreleaser release --snapshot --clean --skip=nix
MAGNETOWID_SMOKE_DIST=$(CURDIR)/dist go test -count=1 -timeout 30m -run TestPackageService ./cmd/magnetowid
# Requires Linux, Docker, and ffmpeg with libx264.
SONARR_IMAGE ?= lscr.io/linuxserver/sonarr:4.0.20.3014-ls326@sha256:f247545d23ba8b233d6604575347e48a623fe6ad75dda02348bf81917f3b5c06
RADARR_IMAGE ?= lscr.io/linuxserver/radarr:6.4.4.10685-ls319@sha256:7dfd049e79c00b16fbc29c3f5d96a9e7b9e73a23930b4c5b3c4541d60b366814
integration:
MAGNETOWID_SONARR_IMAGE=$(SONARR_IMAGE) MAGNETOWID_RADARR_IMAGE=$(RADARR_IMAGE) \
go test -count=1 -timeout 20m -v -run TestSonarrAndRadarr ./cmd/magnetowid
live:
MAGNETOWID_LIVE=1 go test -count=1 -v -run TestLive ./internal/provider/tvp ./internal/provider/bbc
# Build release artifacts without publishing.
snapshot:
goreleaser release --snapshot --clean
clean:
rm -rf dist $(BINARY)