DEVX-83: fix: fail lint-dockerfiles when hadolint is missing

This commit is contained in:
emil
2026-06-27 16:43:22 +00:00
parent 1a28f5dcc5
commit 233a0bc055
3 changed files with 50 additions and 7 deletions
+7 -5
View File
@@ -33,6 +33,8 @@ setup-release: $(VENV)/bin/activate .env
# Setup for pre-built image jobs (deps already in image, just link venv + install project)
setup-image:
@if [ -d /opt/venv ]; then ln -sf /opt/venv .venv; . .venv/bin/activate && pip install -e . --no-deps 2>/dev/null; \
export PATH="$$HOME/.local/bin:$$PATH"; \
python3 -m devx.tools.install_tools --tool hadolint 2>/dev/null || true; \
else echo "[setup-image] /opt/venv not found — falling back to setup-ci"; $(MAKE) setup-ci; fi
.env:
@@ -101,12 +103,12 @@ lint-all: lint workflow-lint lint-dockerfiles
lint-dockerfiles:
@echo "[lint-dockerfiles] Linting Dockerfiles with hadolint..."
@if command -v hadolint >/dev/null 2>&1; then \
find docker -name 'Dockerfile*' -exec hadolint {} +; \
echo "[lint-dockerfiles] All Dockerfiles passed."; \
else \
echo "[lint-dockerfiles] hadolint not found — skipping (install with: pip install hadolint or download from GitHub)"; \
@if ! command -v hadolint >/dev/null 2>&1; then \
echo "[lint-dockerfiles] ERROR: hadolint not found. Install from https://github.com/hadolint/hadolint/releases" >&2; \
exit 1; \
fi
@find docker -name 'Dockerfile*' -exec hadolint {} +
@echo "[lint-dockerfiles] All Dockerfiles passed."
test-unit: devx-test-unit