From c5d71104a016870a7192d85fecfa3e67cb9913f0 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Thu, 1 Dec 2016 10:20:45 +0200 Subject: [PATCH] - Removed lint target, pre-commit already handles that. - Filled in fields in license. - Removed useless checks in pre-commit. - Added make test check to pre-commit. - Added Travis CI. - Updated README accordingly. --- .pre-commit-config.yaml | 18 +++++++----------- .travis.yml | 27 +++++++++++++++++++++++++++ LICENSE.txt | 4 ++-- Makefile | 11 ++--------- README.rst | 13 ++++++------- 5 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 .travis.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f2586c1..9693120 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,21 +2,17 @@ sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f hooks: - id: check-added-large-files - - id: check-json - - id: check-xml - id: check-yaml - id: check-merge-conflict +- repo: https://www.shore.co.il/git/shell-pre-commit/ + sha: v0.1.0 + hooks: + - id: shell-lint + files: ssl-ca - repo: local hooks: - - id: local_test + - id: test name: make test entry: make test language: system - always_run: True - files: Makefile - -- repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: 604fe77b53d3514d5ad0f66764c7783850bb6e98 - hooks: - - id: shell-lint - files: ssl-ca + files: Makefile|ssl-ca diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e3a68d0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +--- +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 diff --git a/LICENSE.txt b/LICENSE.txt index 38c6bf2..26259f8 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) [year] [fullname] +Copyright (c) 2016 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 diff --git a/Makefile b/Makefile index fe7445b..5b7a85b 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,10 @@ -.PHONY: install clean test lint +.PHONY: install test install: cp ssl-ca /usr/local/bin/ssl-ca chmod 755 /usr/local/bin/ssl-ca -clean: - if [ -f .server.pid ]; then kill "$$(cat .server.pid)"; fi - rm -rf openssl.cnf certs keys CA.key CA.crt CA.p12 CA.srl .server.pid - -lint: - /bin/sh -en ssl-ca - -test: clean lint +test: ./ssl-ca init test "$$(openssl rsa -noout -check -in CA.key)" = "RSA key ok" test "$$(openssl verify -CAfile CA.crt CA.crt)" = "CA.crt: OK" diff --git a/README.rst b/README.rst index 3a8f768..9c6490a 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,9 @@ SSL-CA ###### +.. image:: https://travis-ci.org/adarnimrod/ssl-ca.svg?branch=master + :target: https://travis-ci.org/adarnimrod/ssl-ca + This utility automates generating an SSL certificate authority, keys and signed certificates. The dependencies are: OpenSSL, cURL git and make (for testing and installation, although you can just copy the file). The use case in mind is @@ -68,10 +71,9 @@ other cert on the internet. Development ----------- -To ease development :code:`make clean`, :code:`make lint` and :code:`make test` -are available. It's recommended to add :code:`make lint` and :code:`make test` -to to your Git pre-commit and pre-push hooks accordingly. Also, this repo has -`pre-commit <http://pre-commit.com/>`_ configured. +For testing run :code:`make test`. For cleaning temporary files run :code:`git +clean -fdx`. You can use `pre-commit <http://pre-commit.com/>`_ to have the test +(which is quite quick) run on every commit to ensure quality code. License ------- @@ -86,6 +88,3 @@ 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/cgit/. - -TODO ----- -- GitLab