Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
IamTheFij | d67a852ae8 | |
IamTheFij | 6cf8fe749d | |
IamTheFij | f626253b23 | |
IamTheFij | 15a900b1bb | |
IamTheFij | 098ffc1472 |
|
@ -9,9 +9,8 @@ workspace:
|
|||
steps:
|
||||
|
||||
- name: test
|
||||
image: iamthefij/drone-pre-commit:latest
|
||||
image: iamthefij/drone-pre-commit@sha256:6ed8dae6b0067bd2e145e36421bcfbbc68975ff7ddaa5a3f285b5bcdaf0989c8
|
||||
commands:
|
||||
- pip install docker-compose
|
||||
- make all
|
||||
|
||||
- name: notify
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
- id: docker-compose-check
|
||||
name: Validate docker-compose files
|
||||
description: Checks that docker-compose files are valid
|
||||
name: Validate docker compose files
|
||||
description: Checks that docker compose files are valid
|
||||
language: script
|
||||
entry: compose-check.sh
|
||||
files: (docker-)?compose.y[a]{0,1}ml$
|
||||
files: (docker-)?compose\.ya?ml$
|
||||
|
|
6
Makefile
6
Makefile
|
@ -2,7 +2,7 @@
|
|||
|
||||
all: check test
|
||||
|
||||
test: test-negative test-positive
|
||||
test: test-negative test-positive test-hooks
|
||||
|
||||
.PHONY: test-positive
|
||||
test-positive:
|
||||
|
@ -16,6 +16,10 @@ test-negative:
|
|||
@echo "Check multiple files. Should error."
|
||||
./compose-check.sh tests/docker-compose* && { echo 'fail'; exit 1; } || echo 'ok'
|
||||
|
||||
.PHONY: test-hooks
|
||||
test-hooks:
|
||||
pre-commit try-repo . --all-files
|
||||
|
||||
# Installs pre-commit hooks
|
||||
.PHONY: install-hooks
|
||||
install-hooks:
|
||||
|
|
|
@ -19,4 +19,4 @@ and then run `pre-commit autoupdate`.
|
|||
## Hooks
|
||||
|
||||
### docker-compose-check
|
||||
Verifies that docker-compose files are valid by using `docker-compose config` to parse them.
|
||||
Verifies that docker compose files are valid by using `docker compose config` to parse them.
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
echo "Hadolint hooks have been deprecated in favor of upstream"
|
||||
echo "repo: https://github.com/hadolint/hadolint"
|
||||
echo "Replace hook 'hadolint' with 'hadolint-docker'"
|
||||
echo "Replace hook 'hadolint-system' with 'hadolint'"
|
||||
|
||||
exit 1
|
Loading…
Reference in New Issue