fake-smtp/Makefile

68 lines
1.4 KiB
Makefile

DOCKER_DATE_TAG := $(shell date --utc +%Y.%-m.%-d%-H%-M)
YQ_VERSION ?= v4.30.4
YQ_BINARY ?= yq_linux_amd64
tools: tools/yq/bin/yq
tools/yq/bin/yq:
mkdir -p tools/yq/bin
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY} -O tools/yq/bin/yq &&\
chmod +x tools/yq/bin/yq
build:
CGO_ENABLED=0 go build -v -o bin/fake-smtp ./cmd/fake-smtp
docker-image:
docker build \
--build-arg HTTP_PROXY=$(HTTP_PROXY) \
--build-arg HTTPS_PROXY=$(HTTPS_PROXY) \
--build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \
-t fake-smtp:latest \
-f ./misc/docker/Dockerfile \
.
docker-run:
docker run \
--rm -it \
-p 8080:8080 \
-p 2525:2525 \
--tmpfs /app/data \
fake-smtp:latest
docker-release:
docker tag fake-smtp:latest bornholm/fake-smtp:latest
docker tag fake-smtp:latest bornholm/fake-smtp:$(DOCKER_DATE_TAG)
docker login
docker push bornholm/fake-smtp:latest
docker push bornholm/fake-smtp:$(DOCKER_DATE_TAG)
test:
go test -v -race ./...
release: dist tools
@./misc/script/release.sh
dist:
npm run build
tidy:
go mod tidy
watch:
go run github.com/cortesi/modd/cmd/modd@v0.8.1
lint:
golangci-lint run --enable-all
tooling:
go get github.com/krishicks/yaml-patch/cmd/yaml-patch
clean:
rm -rf release
rm -rf data
rm -rf vendor
rm -rf bin
.PHONY: lint watch build vendor tidy release