diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..e699e193dd2adb3481366dff8c03cc5f12d728a1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +--- +stages: + - test + +pre-commit: + stage: test + image: adarnimrod/ci-images:pre-commit + variables: + XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" + script: + - pre-commit run --all-files + cache: + paths: + - .cache/ + +test: + stage: test + image: buildpack-deps:bullseye + allow_failure: true + before_script: + - apt-get update + - apt-get install -y bats + script: + - bats . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 179bcb3c568923382ee3f0640685d17959b667ce..3a2cc7550ce2069844e9ee9063ed9de1a19629d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,25 @@ +--- repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - sha: v1.2.3 - hooks: - - id: check-added-large-files - - id: check-yaml - - id: check-merge-conflict - - id: check-symlinks - - id: detect-private-key - - id: trailing-whitespace -- repo: https://github.com/adarnimrod/shell-pre-commit - sha: v0.6.0 - hooks: - - id: shell-lint - - id: shellcheck + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: trailing-whitespace + + - repo: https://github.com/adarnimrod/shell-pre-commit + rev: v0.6.0 + hooks: + - id: shell-lint + - id: shellcheck + + - repo: https://github.com/myint/rstcheck + rev: master + hooks: + - id: rstcheck + + - repo: https://github.com/adrienverge/yamllint + rev: v1.25.0 + hooks: + - id: yamllint diff --git a/.travis.yml b/.travis.yml index 7df7be2885785c4917b373a03123c1a00a5be520..9d1defc045218469b526e41d52a6b3e08c373c5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ install: - pip install pre_commit | cat script: - - pre-commit run --all-files - - bats test.bats || true + - pre-commit run --all-files + - bats test.bats || true notifications: on_failure: never diff --git a/README.rst b/README.rst index 923c5732adfff3a629a6c50463375873dbcdb036..42dcee4fdbb1382e9aed57133a91cef1d3427bd2 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,9 @@ bundle-certs ############ -.. image:: https://travis-ci.org/adarnimrod/bundle_certs.svg?branch=master - :target: https://travis-ci.org/adarnimrod/bundle_certs +.. image:: https://git.shore.co.il/nimrod/bundle_certs/badges/master/pipeline.svg + :target: https://git.shore.co.il/nimrod/bundle_certs/-/commits/master + :alt: pipeline status A shell script to bundle SSL certificates in the correct order. The use case envisioned is programmatically handling SSL certificate renewal. @@ -28,8 +29,8 @@ For regular use: For testing/ development purposes, all of the above, plus: -- `Bats `_. -- `Pre-commit `_. +- Bats_ +- Pre-commit_ Usage ----- @@ -61,9 +62,8 @@ Shell functions Development and testing ----------------------- -Testing is done using Bats `_. To test run -:code:`bats test.bats`. `Pre-commit `_ is also -configured for this repo. +Testing is done using Bats_. To test run :code:`bats test.bats`. Pre-commit_ is +also configured for this repo. License ------- @@ -77,4 +77,7 @@ Author Information Nimrod Adar, `contact me `_ or visit my `website `_. Patches are welcome via `git send-email `_. The repository is located -at: https://www.shore.co.il/cgit/. +at: https://git.shore.co.il/explore/. + +.. _Bats: https://github.com/sstephenson/bats +.. _Pre-commit: https://pre-commit.com/ diff --git a/test.bats b/test.bats old mode 100755 new mode 100644 index fbfece2189251f436cf85d9a63af3ae433c5a824..24bc76808ff08abdc57aae32d1c8c8e1fbb6f7d1 --- a/test.bats +++ b/test.bats @@ -1,5 +1,3 @@ -#!/usr/bin/env bats - setup () { teardown mkdir -p .testcerts