fake-smtp/Makefile

68 lines
1.3 KiB
Makefile
Raw Permalink Normal View History

2022-11-22 22:18:28 +01:00
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
2020-11-03 12:43:16 +01:00
2020-11-03 11:48:53 +01:00
build:
CGO_ENABLED=0 go build -v -o bin/fake-smtp ./cmd/fake-smtp
2020-04-17 17:53:01 +02:00
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
2020-11-03 12:43:16 +01:00
docker tag fake-smtp:latest bornholm/fake-smtp:$(DOCKER_DATE_TAG)
2020-04-17 17:53:01 +02:00
docker login
docker push bornholm/fake-smtp:latest
2020-11-03 12:43:16 +01:00
docker push bornholm/fake-smtp:$(DOCKER_DATE_TAG)
2020-04-17 17:53:01 +02:00
test:
go test -v -race ./...
2022-11-22 22:18:28 +01:00
release: dist tools
2020-04-17 17:53:01 +02:00
@./misc/script/release.sh
dist:
npm run build
tidy:
go mod tidy
watch:
modd
lint:
golangci-lint run --enable-all
2020-04-30 10:18:45 +02:00
tooling:
go get github.com/krishicks/yaml-patch/cmd/yaml-patch
2020-04-17 17:53:01 +02:00
clean:
rm -rf release
rm -rf data
rm -rf vendor
rm -rf bin
.PHONY: lint watch build vendor tidy release