Fixup version tests to use build object

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add tests for build object

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add an instance variable for the rake args
Add ability to do a build exclusively from a params file

This last commit completely decouples the build file from the build to be
performed, allowing us to queue this with Jenkins.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Fix #git_co error message and rename internal variables
Add a utility method to return the git sha of HEAD

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add sha and distribution server to variables tracked within build

This allows us to check out a specific sha prior to build, in case the source
repository has changed since the build was submitted to the remote build
system. Distribution server will be necessary for tracking builds later.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add :pl alias tasks for package:gem and package:dmg

These are hidden alias tasks that allow us to dramatically simplify the logic
in jenkins.rake. Instead of dealing with two separate namespaces, we can just
account for one.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add a jenkins.rake for submitting builds to jenkins

This commit adds a jenkins.rake file to the packaging repo. The jenkins tasks
enable the packaging repo to kick off packaging builds on a remote jenkins
instance. They work in a similar way to the :remote tasks, but with a few key
differences. The jenkins tasks transmit information to a jenkins coordinator,
which handles the rest. The data passed are the following
- a git-bundle from HEAD of the current project, which is cloned on the
  builder to set up a duplicate of this environment. This uses the existing
  git-bundle functionality of the packaging repo. This allows us to design
  generic jenkins-jobs that are project-agnostic.
- a build parameters file, containing all information about the build
- the "type" of build, e.g. rpm, deb, gem, etc The jenkins url and job name
  are obtained via the team build-data file at
  git@github.com/puppetlabs/build-data
- the project we're building, e.g. facter, puppet. This is used later in
  determining the target for the build artifacts on the distribution server

The tasks post to jenkins via curl, with an assembled string of arguments
including the files to upload and the appropriate json. Information about the
jenkins job and url are obtained from the extras data loaded in from the team
builder_data.yaml file. This commit adds tasks for deb, deb_all, mock,
mock_all, gem, and dmg.
Add comments to load_data_from_yaml in 00_utils.rake
Name the parameters file a git sha

By naming the parameters file the git sha, we ensure params file uniqueness
among those created within the project, and also provide an easy way to track
builds that are sent to jenkins.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add retrieve task

This commit adds a pl:jenkins:retrieve task for retrieving packages that
jenkins has built from the distribution server.
Make no tarball not an exit failure on sign

With the advent of signing remotely of all the things, we need it to not be an
error if the tarball doesn't exist. There's no reason for it to fail anyway, so
we might as well just not sign if if its not there.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add task for signing packages after they've been staged

This is a piece of the jenkins chain. This task allows us to take locally
staged packages and ship them to the distribution server (known to have tools
for all kinds of signing), sign them, and bring them back. The twist is, we
don't want to duplicate all the hacky logic already in the packaging repo to
do this, so we send the packaging repo along with it, via the remote
bootstrap workflow already used in the remote tasks. Signed packages are
then retrieved and ready to go. This is actually an unfortunate duplication of
the logic of pl:remote, but it is necessary because we have to deviate
from that workflow because we're handling files that aren't in git - everything
under pkg.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Remove test for root in building apple packages, use sudos

We should call 'sudo' to do everything we need sudo for, so checking that we're
running as root is not necessary, as it makes generic automation incredibly
difficult. This commit updates the script to do so. It also removes a strange
recursive chmod to 755 of the entire pkg directory. I'm fairly certain we don't
want to do this. Given the strange behavior we've experienced with apple
packaging, packages have been built and fdiffed before and after this commit to
ensure they are identical.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add pl: and pe:tar aliases for jenkins automation
Check for build property pe version, not env var

This way when we build from a params file, we're not uselessly checking for an
environment variable we swore we'd never send again on a remote task.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add a utility method for posting via curl
Add a jenkins ship to ship to distribution server

This commit adds the ability to ship packages to the distribution server, so
that we can archive them, create repos from them, etc.
Add an rpm_repos.rake for creating rpm repos on distribution server

This commit add support for creating yum repositories on the distribution
server with the packages built for this commit. This commit also adds automatic
repository config creation for these repos, so we can pass the configs to hosts
for installing the packages.