Makefile: auto-incrementing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE_NAME := whatever/whatever | |
.PHONY: docker-build version-increment bc-check | |
docker-build: version-increment | |
DOCKER_BUILDKIT=1 docker buildx build -t $(IMAGE_NAME):v$(shell cat version.txt) . | |
version-increment: bc-check | |
bc <<< "1 + $(shell cat version.txt)" > version.txt | |
bc-check: | |
@command -v bc >/dev/null 2>&1 || { echo >&2 "I require bc but it's not installed. Aborting."; exit 1; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment