Checkpoint
[pwan.org.git] / content / lessons / Certmaster.rst
diff --git a/content/lessons/Certmaster.rst b/content/lessons/Certmaster.rst
new file mode 100644 (file)
index 0000000..0be6718
--- /dev/null
@@ -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 <<EOF
+   this text will get assigned to variable.
+   EOF
+
+
+.. _certmaster: https://fedorahosted.org/certmaster/
+.. _my fork of certmaster: https://pwan.org/git/?p=certmaster.git;a=summary
+.. _bats: https://github.com/sstephenson/bats
+.. _this engine yard post: https://blog.engineyard.com/2014/bats-test-command-line-tools
+.. _shunit2: https://code.google.com/p/shunit2/
+