fake-smtp/Makefile

82 lines
2.0 KiB
Makefile
Raw Permalink Normal View History

2024-03-21 09:09:57 +01:00
DOCKER_REPOSITORY ?= reg.cadoles.com/cadoles
2022-11-22 22:18:28 +01:00
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:
git tag -a $(MKT_PROJECT_VERSION) -m "v$(MKT_PROJECT_VERSION)" || exit 0
2020-04-17 17:53:01 +02:00
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: .mktools
docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION)
docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION)
docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION_CHANNEL)-latest
docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION_CHANNEL)-latest
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION)
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION)
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION_CHANNEL)-latest
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION_CHANNEL)-latest
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:
2024-02-27 17:19:16 +01:00
go run github.com/cortesi/modd/cmd/modd@v0.8.1
2020-04-17 17:53:01 +02:00
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: mktools
mktools:
rm -rf .mktools
curl -q https://forge.cadoles.com/Cadoles/mktools/raw/branch/master/install.sh | $(SHELL)
.mktools:
$(MAKE) mktools
-include .mktools/*.mk
2020-04-17 17:53:01 +02:00
.PHONY: lint watch build vendor tidy release