diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ebbc41b0e9940a159664f02f506f96341b8f84e1..1f5902ceaef5ed8a1a3f5c455501aa8daee9ef3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,22 @@ image: adarnimrod/ci-images:docker stages: + - test - build - run +pre-commit: + stage: test + tags: ["ns4.shore.co.il"] + image: adarnimrod/ci-images:pre-commit + variables: + XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" + script: + - pre-commit run --all-files + cache: + paths: + - .cache/ + build: stage: build tags: ["ns4.shore.co.il"] @@ -17,6 +30,7 @@ run: when: manual script: - docker-compose up --detach --quiet-pull --remove-orphans + # yamllint disable rule:line-length - | for i in $(seq 12) do diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..41f9b1a1fb0f8ac759a2cb722ac9f8ceb9292732 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +# vim:ff=unix ts=2 sw=2 ai expandtab +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.3.0 + hooks: + - id: check-added-large-files + - id: check-merge-conflict + - id: detect-private-key + - id: trailing-whitespace + - repo: https://github.com/adrienverge/yamllint + rev: v1.25.0 + hooks: + - id: yamllint + - repo: https://github.com/amperser/proselint/ + rev: 0.10.2 + hooks: + - id: proselint + types: [plain-text] + exclude: LICENSE + - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git + rev: v0.3.0 + hooks: + - id: hadolint + - id: docker-compose diff --git a/Dockerfile b/Dockerfile index 1386c21f05b00aa407258119a9b7be97ef0e2a6d..ab9c492c0529fbb79fab45c16c82b15f90f9ab76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM buildpack-deps:bullseye +# hadolint ignore=DL3008 RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ + DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \ apache2-utils \ bats \ bundler \