diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..128c0f02ba1d320e5a02a3395524a7e230ee5b5e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,50 @@ +--- +image: adarnimrod/ci-images:docker + +stages: + - test + - build + - run + +pre-commit: + stage: test + image: adarnimrod/ci-images:pre-commit + variables: + XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" + # Disabled until https://github.com/pre-commit/pre-commit/issues/1387 is + # resolved. + SKIP: "hadolint,docker-compose" + script: + - pre-commit run --all-files + cache: + paths: + - .cache/ + +build: + stage: build + tags: ["host01.shore.co.il"] + variables: + COMPOSE_DOCKER_CLI_BUILD: "1" + DOCKER_BUILDKIT: "1" + # Fix the permissions because of + # https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1736. + before_script: + - chmod 644 exim4/exim4.conf + script: + - docker-compose build --no-cache --pull + - docker-compose pull --quiet + +run: + stage: run + tags: ["host01.shore.co.il"] + when: manual + script: + - docker-compose up --detach --remove-orphans + # yamllint disable rule:line-length + - | + for i in $(seq 12) + do + docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' || break + sleep 10 + done + ! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e1840474cac88ee373face0a82bd4708dbcc16d..dee5c99e096301384d75860bc3479bcf143976e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: rev: v2.3.0 hooks: - id: check-added-large-files + - id: check-executables-have-shebangs - id: check-merge-conflict - id: detect-private-key - id: trailing-whitespace @@ -19,7 +20,7 @@ repos: - id: proselint types: [plain-text] exclude: LICENSE - - repo: https://www.shore.co.il/git/docker-pre-commit + - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/ rev: v0.3.0 hooks: - id: docker-compose @@ -29,3 +30,8 @@ repos: hooks: - id: detect-secrets exclude: \.diff$ + - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + rev: v0.6.0 + hooks: + - id: shell-lint + - id: shellcheck diff --git a/README.md b/README.md index e96727972afad079b47834c9e3aa72cba4b8f4ab..090afdceade687548629f69ec81293ecde2dbe22 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ This software is licensed under the MIT license (see `LICENSE.txt`). Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website]( https://www.shore.co.il/). Patches are welcome via [`git send-email`]( http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is located -at: . +at: . diff --git a/exim4/Dockerfile b/exim4/Dockerfile index f18dd2fdada2dd45dfaa3cdb10bcbe3c8cd9d9ae..c021969094511ac790c0c68308973561827cf777 100644 --- a/exim4/Dockerfile +++ b/exim4/Dockerfile @@ -25,8 +25,8 @@ RUN apt-get update && \ rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/* COPY --chown=root:root entrypoint /usr/local/bin/ COPY --chown=Debian-exim:Debian-exim aliases /etc/aliases -COPY exim4.conf /etc/exim4/exim4.conf -RUN exim4 -bV +COPY --chown=root:root exim4.conf /etc/exim4/exim4.conf +RUN ls -l /etc/exim4/exim4.conf && exim4 -bV #USER Debian-exim WORKDIR /var/spool/exim4 ENTRYPOINT ["entrypoint"]