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.
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.
Add ability to create yum configs automatically

This commit adds functionality for automatically generating yum configs from
the package repositories we create. The yum configs are created by checking out
the ref that was packaged and running rake pl:jenkins:rpm_repo_configs. These
can be passed to hosts for installing the packages.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Add task for posting to jenkins job with SHA

This commit adds a task that allows us to post to a url with a form upload of
the SHA of head. In tandem with the next commit, it allows us to trigger
downstream acceptance jobs.
Support downstream job param to jenkins jobs

This commit adds support for triggering a downstream job after the completion
of the jenkins job, by passing a parameter up to the jenkins job with the URL
to trigger. This effectively allows us to set up acceptance jobs that will run
after packaging is complete.
Update jenkins.rake jenkins job shell example
Update README.md