Skip to content

Commit

Permalink
Merge pull request #3 from deeagle/dev/task_add-hadolint
Browse files Browse the repository at this point in the history
Dev/task add hadolint
  • Loading branch information
deeagle authored Jun 5, 2024
2 parents 4d74e08 + e339751 commit 5db1fb3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.git
.gitignore
.idea
.hadolint.yml
.markdownlint.yml
.releaserc
Dockerfile
run-ci.sh
10 changes: 10 additions & 0 deletions .hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Hadolint configuration file

failure-threshold: info
strict-labels: false

# configure ignore rules
# see https://github.com/hadolint/hadolint#rules for a list of available rules.
ignored:
- DL3016
- DL3018
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM python:3-alpine3.20

LABEL org.opencontainers.image.authors="Martin Kock <[email protected]>" \
org.opencontainers.image.url="https://github.com/deeagle/dspyce-demo-app" \
org.opencontainers.image.licenses="GPL3" \
org.opencontainers.image.title="dspyce-demo-app" \
org.opencontainers.image.description="Container which includes a DSpyce-demo to talk to DSpace-Demo." \
org.opencontainers.image.vendor="deeagle.de"

WORKDIR /app

COPY ["requirements.txt", "requirements.txt"]
Expand Down
9 changes: 9 additions & 0 deletions run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ docker run --rm -v "$(pwd):/app" docdee/mdlint -c /app/.markdownlint.yml -i CHAN
echo "Lint shell scripts ..."
docker run --rm -v "$(pwd):/app" koalaman/shellcheck-alpine:stable find /app -type f -name '*.sh' -exec shellcheck {} +

echo "Lint Dockerfiles ..."
docker_linter_version="$(docker run --rm -i ghcr.io/hadolint/hadolint hadolint -v)"
echo "Using docker-linter version: ${docker_linter_version}"
dockerfiles=$(find . -type f -name "*Dockerfile" -not -path "./vendor/*" -not -path "./tmp/*")
for dockerfile in ${dockerfiles}; do
echo "> lint file: $dockerfile"
docker run --rm -i -v "${PWD}/.hadolint.yml:/.config/hadolint.yml" ghcr.io/hadolint/hadolint < "$dockerfile"
done

echo "Lint code (flake8) ..."
echo "> we want O's"
# stop the build if there are Python syntax errors or undefined names
Expand Down

0 comments on commit 5db1fb3

Please sign in to comment.