webp_server_go/Makefile
Nova Kwok 9268ada0b3
A better way to handle remote content-type, fix etag (#216)
* A better way to handle remote content-type, fix etag

* Check for err

* Optimize on fetchRemoteImage

* Write 600 permission

* Implement simple lock for write operation

* Removing typo

* Removing typo

* Setup cache

* Fix CI

* Fix retry and remove genEtag

* Fix error note

* remove duplicate Get

* WTF

* Fix tests

* remove broken test

* Fix broken tests
2023-05-29 19:41:39 +08:00

42 lines
953 B
Makefile

ifeq ($(shell uname),Linux)
OS=linux
else
OS=darwin
endif
ifeq ($(shell uname -m),aarch64)
ARCH=arm64
else
ARCH=amd64
endif
default:
make clean
go build -o builds/webp-server-$(OS)-$(ARCH) .
ls builds
all:
make clean
./scripts/build.sh $(OS) $(ARCH)
tools-dir:
mkdir -p tools/bin
install-staticcheck: tools-dir
GOBIN=`pwd`/tools/bin go install honnef.co/go/tools/cmd/staticcheck@latest
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ./tools/bin v1.52.2
static-check: install-staticcheck
#S1000,SA1015,SA4006,SA4011,S1023,S1034,ST1003,ST1005,ST1016,ST1020,ST1021
tools/bin/staticcheck -checks all,-ST1000 ./...
GO111MODULE=on tools/bin/golangci-lint run -v $$($(PACKAGE_DIRECTORIES)) --config .golangci.yml
test: static-check
go test -v -coverprofile=coverage.txt -covermode=atomic
clean:
rm -rf builds
rm -rf prefetch
docker:
DOCKER_BUILDKIT=1 docker build -t webpsh/webps .