Add tests
These aren't run on drone yet as there is no pre-commit plugin!
This commit is contained in:
parent
09fb067889
commit
6481b89b0c
@ -3,4 +3,4 @@ repos:
|
|||||||
- repo: https://github.com/IamTheFij/docker-pre-commit
|
- repo: https://github.com/IamTheFij/docker-pre-commit
|
||||||
rev: v2.0.0
|
rev: v2.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: hadolint
|
- id: hadolint-system
|
||||||
|
10
Makefile
10
Makefile
@ -1,11 +1,17 @@
|
|||||||
|
DOCKER_TAG = drone-pre-commit-$(USER)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: test
|
default: test
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: build
|
||||||
@echo noop
|
docker run --rm -v $(shell pwd):/src:ro --workdir /src $(DOCKER_TAG) ./tests/steps.sh
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: ./Dockerfile
|
||||||
|
docker build -t $(DOCKER_TAG) .
|
||||||
|
|
||||||
.PHONY: install-hooks
|
.PHONY: install-hooks
|
||||||
install-hooks:
|
install-hooks:
|
||||||
|
9
tests/steps.sh
Executable file
9
tests/steps.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# These simulate commands added to a pipeline step
|
||||||
|
|
||||||
|
wget -L -O /usr/bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.18.0/hadolint-Linux-x86_64
|
||||||
|
chmod +x /usr/bin/hadolint
|
||||||
|
|
||||||
|
pre-commit run --all-files
|
Loading…
Reference in New Issue
Block a user