Pre-Commit hooks for validating Docker projects
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.

27 lines
698 B

.PHONY: all test clean
all: check test
test: test-negative test-positive
.PHONY: test-positive
@echo "Check valid compose file."
./ tests/docker-compose.yml || { echo 'fail'; exit 1; }
.PHONY: test-negative
@echo "Check bad file. Should error."
./ tests/docker-compose.bad.yml && { echo 'fail'; exit 1; } || echo 'ok'
@echo "Check multiple files. Should error."
./ tests/docker-compose* && { echo 'fail'; exit 1; } || echo 'ok'
# Installs pre-commit hooks
.PHONY: install-hooks
pre-commit install --install-hooks
# Checks files for encryption
.PHONY: check
pre-commit run --all-files