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.
Add uber workflow for jenkins

This commit adds tasks for building all the things with jenkins and signing
them with the soon-to-be jenkins sign_all task.
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>
Pull logic out and abstract for PE builds
Add a utility method for posting via curl
Add a jenkins ship to ship to distribution server
Add an rpm_repos.rake for creating rpm repos on distribution server
Add deb_repos.rake, which sets up debian repos for us

This commit adds the automatic creation of debian repositories for the jenkins
build artifacts on the distribution server under the standard location
/opt/jenkins-builds/$project/$sha/repos/deb" where $sha is the git commit sha
of HEAD. With this commit creating the repositories also automatically creates
apt source config files for each packaged distribution, for use later in
acceptance testing, etc.
Split deb repos out into their own task