X-Git-Url: https://pwan.org/git/?p=pwan.org.git;a=blobdiff_plain;f=content%2Flessons%2FCertmaster.rst;fp=content%2Flessons%2FCertmaster.rst;h=0be6718ad2a3b60518bc090efde48f8c3b5f17fa;hp=0000000000000000000000000000000000000000;hb=6b4cb8e61e634b989a887c60fdd26d7140a8224f;hpb=78cc7b9eb414b40bc21c491f6809929573fffc7b diff --git a/content/lessons/Certmaster.rst b/content/lessons/Certmaster.rst new file mode 100644 index 0000000..0be6718 --- /dev/null +++ b/content/lessons/Certmaster.rst @@ -0,0 +1,36 @@ +Certmaster lessons learned +########################## + +:date: 2015-12-18 +:tags: lessons,certmaster +:category: lessons +:author: Jude N + +I'm started occassional series about lessons I've learned after finishing with a project. The kick-off article is about a `certmaster`_ fork I've been working on. +I've been using certmaster at $work for a few years now, but when we wanted to start using multiple certificate authorities, we had to spin up different instances of certmaster, with each instance +using on its own IP/port. It would be better if a single instance of certmaster could serve multiple CA's by adding a '--ca' flag. This is the functionality that `my fork of certmaster`_ provides, and +here are the lessons I learned while working on this: + +bats versus shunit2 +------------------- +certmaster doesn't include any tests, so I wanted to write some functional tests to verify my changes worked as expected. + +I started out working with `bats_`, but it fell down when I needed to push a command into the background - it just wouldn't do it. I tried the 'gotcha' suggestions from `this engine yard post`_ but to no avail. +I switched the tests to `shunit2`_ and had no trouble pushing commands into the background. + +Assigning here documents to variables +------------------------------------- + +.. code-block:: bash + + variable=$(cat <