sendmail/Makefile

48 lines
1.1 KiB
Makefile
Raw Normal View History

2020-04-29 10:12:03 +02:00
VERS_MAJOR := 0
2020-05-05 10:25:56 +02:00
VERS_MINOR := 5
2020-04-29 10:12:03 +02:00
VERSION := $(VERS_MAJOR).$(VERS_MINOR)
NEW_MINOR := $$(( $(VERS_MINOR) + 1 ))
NEW_MAJOR := $$(( $(VERS_MAJOR) + 1 ))
output:
output/sendmail: output
go build -o output/sendmail -ldflags "-X main.version=$(VERSION)" ./...
output/sendmail-dev: output
go build -o output/sendmail-dev ./...
clean:
rm output/*
build: clean output/sendmail
docker-build:
docker build --build-arg=version=$(VERSION) -t leophys/mailer:$(VERSION) .
dev-build: clean output/sendmail-dev
2020-04-29 10:12:03 +02:00
bumpvers-minor:
sed -i"" "s/VERS_MINOR := $(VERS_MINOR)/VERS_MINOR := $(NEW_MINOR)/" Makefile
git add Makefile
git commit -m "Bump version $(VERSION) -> $(VERS_MAJOR).$(NEW_MINOR)"
git tag $(VERS_MAJOR).$(NEW_MINOR)
bumpvers-major:
sed -i"" "s/VERS_MAJOR := $(VERS_MAJOR)/VERS_MAJOR := $$(( $(VERS_MAJOR) + 1 ))/" Makefile
git add Makefile
git commit -m "Bump version $(VERSION) -> $(NEW_MAJOR).$(VERS_MINOR)"
git tag $(NEW_MAJOR).$(VERS_MINOR)
release-min:
make bumpvers-minor
make build
make docker-build
2020-04-29 10:12:03 +02:00
release-maj:
make bumpvers-major
make build
make docker-build
2020-04-29 10:12:03 +02:00
PHONY: bumpvers-minor bumpvers-major release-min release-maj clean docker-build