Skip to content
Snippets Groups Projects
Commit 02790ef3 authored by nimrod's avatar nimrod
Browse files

- Moved lint to pre-commit.

- Added local hook to run make test to pre-commit.
- Added Travis CI.
- Updated README accordingly.
parent 1145be89
No related branches found
No related tags found
No related merge requests found
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-json
- id: check-xml
- id: check-yaml
- id: check-merge-conflict - id: check-merge-conflict
- repo: https://www.shore.co.il/git/shell-pre-commit/ - repo: https://www.shore.co.il/git/shell-pre-commit/
sha: 604fe77b53d3514d5ad0f66764c7783850bb6e98 sha: v0.1.0
hooks: hooks:
- id: shell-lint - id: shell-lint
files: bundle-certs files: bundle_certs
- repo: local
hooks:
- id: test
name: make test
language: system
entry: make test
files: bundle_certs
---
language: python
python: "2.7"
dist: trusty
sudo: false
group: beta
cache:
- pip
- directories:
- $HOME/.pre-commit
addons:
apt:
packages:
- mawk
- openssl
- curl
- build-essential
install:
- pip install pre_commit
script:
- pre-commit run --all-files
notifications:
email: false
.PHONY: test clean lint .PHONY: test
lint:
/bin/sh -en bundle_certs
clean:
if [ -f .server.pid ] && [ -d "/proc/$$(cat .server.pid)" ]; then kill "$$(cat .server.pid)"; fi
rm -rf .testcerts certs .server.pid
.testcerts: .testcerts:
mkdir -p .testcerts mkdir -p .testcerts
...@@ -52,7 +45,7 @@ clean: ...@@ -52,7 +45,7 @@ clean:
.testcerts/bundle.crt: .testcerts/intermediates.crt .testcerts/server.crt .testcerts/bundle.crt: .testcerts/intermediates.crt .testcerts/server.crt
./bundle_certs .testcerts/* > .testcerts/bundle.crt ./bundle_certs .testcerts/* > .testcerts/bundle.crt
test: lint .testcerts/bundle.crt .testcerts/root.crt .testcerts/server.key test: .testcerts/bundle.crt .testcerts/root.crt .testcerts/server.key
openssl s_server -cert .testcerts/bundle.crt -key .testcerts/server.key -quiet -www -no_dhe & echo "$$!" > .server.pid openssl s_server -cert .testcerts/bundle.crt -key .testcerts/server.key -quiet -www -no_dhe & echo "$$!" > .server.pid
test "$$(curl --fail --cacert .testcerts/root.crt --write-out '%{ssl_verify_result}' --silent --output /dev/null https://localhost:4433)" = "0" test "$$(curl --fail --cacert .testcerts/root.crt --write-out '%{ssl_verify_result}' --silent --output /dev/null https://localhost:4433)" = "0"
if [ -f .server.pid ] && [ -d "/proc/$$(cat .server.pid)" ]; then kill "$$(cat .server.pid)"; fi if [ -f .server.pid ] && [ -d "/proc/$$(cat .server.pid)" ]; then kill "$$(cat .server.pid)"; fi
......
bundle-certs bundle-certs
############ ############
.. image:: https://travis-ci.org/adarnimrod/bundle_certs.svg?branch=master
:target: https://travis-ci.org/adarnimrod/bundle_certs
A shell script to bundle SSL certificates in the correct order. The use case A shell script to bundle SSL certificates in the correct order. The use case
envisioned is programmatically handling SSL certificate renewal. envisioned is programmatically handling SSL certificate renewal.
...@@ -58,10 +61,9 @@ Shell functions ...@@ -58,10 +61,9 @@ Shell functions
Development Development
----------- -----------
To ease development :code:`make clean`, :code:`make lint` and :code:`make test` For testing run :code:`make test`. For cleaning temporary files run :code:`git
are available. It's recommended to add :code:`make lint` and :code:`make test` clean -fdx`. You can use `pre-commit <http://pre-commit.com/>`_ to have the test
to to your Git pre-commit and pre-push hooks accordingly. Also, this repo has (which is quite quick) run on every commit to ensure quality code.
`pre-commit <http://pre-commit.com/>`_ configured.
License License
------- -------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment