Acceptance: use the new "scp_from" method from puppet-acceptance

In a recent commit to puppet-acceptance I've added an "scp_from"
method, similar to the existing "scp_to" method.  This commit
simply refactors our messy code to use this instead of shelling
out to scp directly from ruby.
Initial scripts / rake tasks for building test packages

This commit does the following:

1) Copy all of the hacky shell code that we are using in Jenkins
   for building our PuppetDB packages into shell scripts in our
   repo.
2) Add a rake task ('test:package') that calls them.

This is not an ideal solution, but it is a step forward.  For now,
it gives us the following benefits:

1) Allows us to track the nastiest parts of our current slew of
   Jenkins jobs in VCS, and get rid of it inside of the Jenkins
   console.
2) Allows us to build a Jenkins job that can run our two packaging
   tasks (rpm, deb) in parallel.

There is more work that should eventually be done here, including
reconciling with Moses' standardized packaging tasks, porting some
or all of this shell stuff over to Ruby, and refactoring to
DRY up some of the repetitive bits.  However, I think this is
a big enough step forward to warrant committing it in its current
state.
Fix default body for static resources

This function checks whether there is a body present before attempting
to set one, and was trying to call `(empty? body)` to do so.
Unfortunately, when serving static files, `body` is an instance of
java.io.File, which naturally doesn't implement ISeq. Now we just check
for the presence of `body`, rather than any particular predicate. This
seems more correct anyway, as it's perfectly reasonable that the correct
response for some routes may indeed be an empty string.

This also adds a test for the / redirect to the dashboard, which has
broken in the past.
Merge pull request #321 from KushalP/master

Don't use threading macro excessively
Merge pull request #320 from nicklewis/static-resource-serving

Fix default body for static resources
Add a FAQ to address some.... FAQs
Merge pull request #322 from nicklewis/faq

Add a FAQ to address some.... FAQs
Merge pull request #318 from cprice-puppet/feature/master/parallel-test-packages

Initial scripts / rake tasks for building test packages
Update URLs to use new v2 endpoint

This commit should update all of the URLs that were still pointing
to v1 to point at v2, except for the test code where we are
explicitly testing the v1 endpoints for backward compatibility.
Merge pull request #317 from cprice-puppet/maint/master/use-acceptance-scp-from

Acceptance: use the new "scp_from" method from puppet-acceptance
Add a possible pending test for fact/resource subquery
Implement fact/resource subquery
Don't go through "resource" column when "certname" works

This avoids duplicates in the case where there are multiple matching
resources, and is much faster to boot!
Get remote nrepl working with newer lein/nrepl.el

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #324 from grimradical/nrepl-fixes

Get remote nrepl working with newer lein/nrepl.el
Add some more tests for fact/resource subqueries
Reduce DB connection pool partition count

We defaulted to creating 5 partitions in our connection pooling code.
Partitions are useful only inasmuch as they reduce lock contention when
attempting to acquire a new connection. Even in high-throughput
environments, we are never bottlenecked on connection acquisition.

By defaulting to 1 partition, we reduce the number of bookkeeping
threads required. Each partition requires 5 bookkeeping threads, so by
reducing the partition count to 1 we eliminate 20 threads, and save
about 20M of resident memory on users systems.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #323 from cprice-puppet/maint/master/update-urls-to-v2

Update URLs to use new v2 endpoint
Add additional tests for fact/resource subqueries
Split subquery into constituent pieces