Commit 7173aa6b authored by nimrod's avatar nimrod
Browse files

Just a dump of what I have in production.

parent 0f7a0c21
Loading
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+49 −0
Original line number Diff line number Diff line
~*
*~
*.sw[op]
*.py[cod]
.DS_Store
__pycache__/
.vagrant/
vendor/
Thumbs.db
*.retry
.svn/
.sass-cache/
*.log
*.out
*.so
node_modules/
.npm/
nbproject/
*.ipynb
.idea/
*.egg-info/
*.[ao]
.classpath
.cache/
bower_components/
*.class
*.[ewj]ar
secring.*
.*.kate-swp
.swp.*
.directory
.Trash-*
build/
_build/
dist/
.tox/
*.pdf
*.exe
*.dll
*.gz
*.tgz
*.tar
*.rar
*.zip
*.pid
*.lock
*.env
.bundle/
!Pipfile.lock

.gitlab-ci.yml

0 → 100644
+46 −0
Original line number Diff line number Diff line
---
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: ["ns4.shore.co.il"]
  variables:
    COMPOSE_DOCKER_CLI_BUILD: "1"
    DOCKER_BUILDKIT: "1"
  script:
    - docker-compose build --no-cache --pull
    - docker-compose pull --quiet

run:
  stage: run
  tags: ["ns4.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$'
+34 −0
Original line number Diff line number Diff line
# vim:ff=unix ts=2 sw=2 ai expandtab
---
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.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.17.0
    hooks:
      - id: yamllint
  - repo: https://github.com/amperser/proselint/
    rev: 0.10.2
    hooks:
      - id: proselint
        types: [plain-text]
        exclude: LICENSE
  - repo: https://github.com/Yelp/detect-secrets
    rev: v0.13.0
    hooks:
      - id: detect-secrets
  - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/
    rev: v0.3.0
    hooks:
      - id: docker-compose
      - id: hadolint
  - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git/
    rev: v0.6.0
    hooks:
      - id: shell-lint
      - id: shellcheck

Dockerfile

0 → 100644
+14 −0
Original line number Diff line number Diff line
# hadolint ignore=DL3007
FROM registry.hub.docker.com/cznic/knot:latest
# hadolint ignore=DL3008
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        gettext-base \
    && \
    rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/*
COPY --chown=root:root entrypoint /usr/local/bin/
COPY --chown=root:root knot.conf /etc/knot/
EXPOSE 53/tcp 53/udp
ENTRYPOINT ["entrypoint"]
CMD ["knotd", "-vc", "/etc/knot/knot.conf"]
HEALTHCHECK CMD knotc status

LICENSE.txt

0 → 100644
+21 −0
Original line number Diff line number Diff line
MIT License

Copyright (c) 2020 Adar Nimrod

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading