Drone plugin to run pre-commit hooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
712 B

DOCKER_TAG = drone-pre-commit-$(USER)
2 years ago
.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 \
2 years ago
.PHONY: install-hooks
pre-commit install --install-hooks
.PHONY: check
pre-commit run --all-files
.PHONY: all
all: check test