2020-09-08 17:14:06 +00:00
|
|
|
DOCKER_TAG = drone-pre-commit-$(USER)
|
2021-02-05 20:33:29 +00:00
|
|
|
DOCKER_TAG_PERSONAL = $(DOCKER_TAG):personal
|
2020-09-08 17:14:06 +00:00
|
|
|
|
2020-09-08 17:00:20 +00:00
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
default: test
|
|
|
|
|
|
|
|
.PHONY: test
|
2021-02-05 20:33:29 +00:00
|
|
|
test: build-personal
|
|
|
|
docker run --rm -v $(shell pwd):/src:ro --workdir /src $(DOCKER_TAG_PERSONAL)
|
2020-09-08 17:14:06 +00:00
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build: ./Dockerfile
|
|
|
|
docker build -t $(DOCKER_TAG) .
|
2020-09-08 20:20:54 +00:00
|
|
|
docker tag "$(DOCKER_TAG):latest" "$(DOCKER_TAG):base"
|
|
|
|
|
|
|
|
.PHONY: build-personal
|
|
|
|
build-personal: build ./Dockerfile.personal
|
2021-02-02 22:49:37 +00:00
|
|
|
docker build \
|
|
|
|
--build-arg "BASE_IMAGE=$(DOCKER_TAG)" \
|
|
|
|
-f ./Dockerfile.personal \
|
2021-02-05 20:33:29 +00:00
|
|
|
-t "$(DOCKER_TAG_PERSONAL)" \
|
2021-02-02 22:49:37 +00:00
|
|
|
.
|
2020-09-08 17:00:20 +00:00
|
|
|
|
|
|
|
.PHONY: install-hooks
|
|
|
|
install-hooks:
|
|
|
|
pre-commit install --install-hooks
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
pre-commit run --all-files
|
|
|
|
|
|
|
|
.PHONY: all
|
2021-02-05 20:33:29 +00:00
|
|
|
all: check test
|