From aeda38e4344482f5b3706072cac4e629ae2c9340 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Mon, 4 Jan 2021 11:13:36 +0200
Subject: [PATCH] Pre-commit.

Also, run it in CI.
---
 .gitlab-ci.yml          |  4 ++++
 .pre-commit-config.yaml | 48 +++++++++++++++++++++++++++++++++++++++++
 README.md               |  2 ++
 3 files changed, 54 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .pre-commit-config.yaml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..077c47a
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,4 @@
+---
+include:
+  - project: shore/ci-templates
+    file: templates/docker-compose.yml
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..13d68fd
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,48 @@
+---
+repos:
+  - repo: https://github.com/pre-commit/pre-commit-hooks.git
+    rev: v3.4.0
+    hooks:
+      - id: check-added-large-files
+      - id: check-executables-have-shebangs
+      - id: check-merge-conflict
+      - id: check-symlinks
+      - id: trailing-whitespace
+
+  - repo: https://github.com/Yelp/detect-secrets
+    rev: v0.14.3
+    hooks:
+      - id: detect-secrets
+
+  - 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://github.com/executablebooks/mdformat.git
+    rev: 0.5.3
+    hooks:
+      - id: mdformat
+
+  - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
+    rev: v0.6.0
+    hooks:
+      - id: shell-lint
+
+  - repo: https://github.com/shellcheck-py/shellcheck-py.git
+    rev: v0.7.1.1
+    hooks:
+      - id: shellcheck
+
+  - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/
+    rev: v0.3.0
+    hooks:
+      - id: hadolint
+      - id: docker-compose
diff --git a/README.md b/README.md
index 0a5ea92..51727a7 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # sogo-docker
 
+[![pipeline status](https://git.shore.co.il/shore/sogo-docker/badges/master/pipeline.svg)](https://git.shore.co.il/shore/sogo-docker/-/commits/master)
+
 Dockerized setup of the [SOGo](https://sogo.nu/) groupware.
 
 ## License
-- 
GitLab