drone-pre-commit/Makefile
Ian Fijolek 47ae0f8a44
All checks were successful
continuous-integration/drone/push Build is passing
Remove tests script and replace by testing with personal image
2021-02-05 12:33:29 -08:00

36 lines
712 B
Makefile

DOCKER_TAG = drone-pre-commit-$(USER)
DOCKER_TAG_PERSONAL = $(DOCKER_TAG):personal
.PHONY: clean
.PHONY: default
default: test
.PHONY: test
test: build-personal
docker run --rm -v $(shell pwd):/src:ro --workdir /src $(DOCKER_TAG_PERSONAL)
.PHONY: build
build: ./Dockerfile
docker build -t $(DOCKER_TAG) .
docker tag "$(DOCKER_TAG):latest" "$(DOCKER_TAG):base"
.PHONY: build-personal
build-personal: build ./Dockerfile.personal
docker build \
--build-arg "BASE_IMAGE=$(DOCKER_TAG)" \
-f ./Dockerfile.personal \
-t "$(DOCKER_TAG_PERSONAL)" \
.
.PHONY: install-hooks
install-hooks:
pre-commit install --install-hooks
.PHONY: check
check:
pre-commit run --all-files
.PHONY: all
all: check test