From e38082d3bf14c5cadca7710e601daa00bb85cc44 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 6 Dec 2020 22:34:11 +0200
Subject: [PATCH] Migrate to GitLab.

Include GitLab CI.
---
 .gitlab-ci.yml          | 57 +++++++++++++++++++++++++++++++++++++++++
 .pre-commit-config.yaml |  6 ++---
 .travis.yml             | 26 -------------------
 README.rst              | 11 ++++----
 setup.py                |  2 +-
 5 files changed, 67 insertions(+), 35 deletions(-)
 create mode 100644 .gitlab-ci.yml
 delete mode 100644 .travis.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6e4eb05
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,57 @@
+---
+stages:
+  - lint
+  - test
+
+pre-commit:
+  stage: lint
+  image: adarnimrod/ci-images:pre-commit
+  variables: &variables
+    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
+    LANG: C.UTF-8
+  script:
+    - pre-commit run -a
+  cache: &cache
+    key: "$CI_JOB_NAME"
+    paths:
+      - .cache/
+
+python2.7:
+  stage: test
+  image: $project:$version-slim
+  allow_failure: true
+  before_script: &before_script
+    - pip install docutils
+  script: &script
+    - $project setup.py check -mrs
+    - pip install ./
+  variables: *variables
+  cache: *cache
+  parallel:
+    matrix:
+      - project: python
+        version:
+          - "2.7"
+      - project: pypy
+        version:
+          - "2.7"
+
+python3:
+  stage: test
+  image: $project:$version-slim
+  before_script: *before_script
+  script: *script
+  variables: *variables
+  cache: *cache
+  parallel:
+    matrix:
+      - project: python
+        version:
+          - "3.6"
+          - "3.7"
+          - "3.8"
+          - "3.9"
+      - project: pypy
+        version:
+          - "3.6"
+          - "3.7"
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f2941a1..6b0e176 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,18 +2,18 @@
 ---
 repos:
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v2.5.0
+    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/Lucas-C/pre-commit-hooks-markup
-    rev: v1.0.0
+    rev: v1.0.1
     hooks:
       - id: rst-linter
   - repo: https://github.com/adrienverge/yamllint
-    rev: v1.21.0
+    rev: v1.25.0
     hooks:
       - id: yamllint
   - repo: https://github.com/amperser/proselint/
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 54f5781..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
----
-language: python
-python:
-  - "2.7"
-  - "3.5"
-  - "3.6"
-  - "3.7"
-  - "3.8"
-dist: bionic
-sudo: false
-group: beta
-cache:
-  - pip
-  - directories:
-      - $HOME/.pre-commit
-
-install:
-  - pip install pre-commit docutils
-
-script:
-  - pre-commit run --all-files
-  - python setup.py check -mrs
-  - pip install ./
-
-notifications:
-  email: false
diff --git a/README.rst b/README.rst
index 6522788..3c5f0a1 100644
--- a/README.rst
+++ b/README.rst
@@ -1,8 +1,9 @@
 Ansible pre-commit hooks
 ########################
 
-.. image:: https://travis-ci.org/adarnimrod/ansible-pre-commit.svg?branch=master
-    :target: https://travis-ci.org/adarnimrod/ansible-pre-commit
+.. image:: https://git.shore.co.il/ansible/ansible-pre-commit/badges/master/pipeline.svg
+    :target: https://git.shore.co.il/ansible/ansible-pre-commit/-/commits/master
+    :alt: CI status
 
 Ansible `pre-commit <http://pre-commit.com/>`_ hooks.
 
@@ -15,7 +16,7 @@ Requirements
 ------------
 
 - Pre-commit 1.2 or later.
-- Python 2.7 or 3.4 or later.
+- Python 2.7 or 3.6 or later.
 
 Installation
 ------------
@@ -24,7 +25,7 @@ Add the following to your :code:`.pre-commit-config.yaml`:
 
 .. code:: yaml
 
-    - repo: https://www.shore.co.il/git/ansible-pre-commit/
+    - repo: https://git.shore.co.il/ansible/ansible-pre-commit.git
       sha: v0.9.0
       hooks:
       - id: ansible-syntax-check
@@ -53,4 +54,4 @@ Author Information
 Nimrod Adar, `contact me <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: https://www.shore.co.il/git/.
+at: https://git.shore.co.il/explore/.
diff --git a/setup.py b/setup.py
index cbbe0da..2df0764 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup
 
 setup(
     name="pre_commit_ansible_dummy_package",
-    url="https://www.shore.co.il/git/ansible-pre-commit",
+    url="https://git.shore.co.il/ansible/ansible-pre-commit",
     author="Nimrod Adar",
     author_email="nimrod@shore.co.il",
     version=open("VERSION", "r").read().strip(),
-- 
GitLab