generate-reprepro-codename: refer to /etc/jenkins/debian_glue

We don't use/ship /usr/share/jenkins-debian-glue/examples/debian_glue
any longer, it's provided as /etc/jenkins/debian_glue instead.
piuparts_wrapper: only expand scriptsdir when it is set

We started quoting $scriptsdir in 841b4b2 in case it is being passed a
string containing spaces.  That caused an issue whenever the scriptsdir
is empty: piuparts would be given an empty string as an argument which
does not play well.

This script makes $scriptdir to only contains the path, and expand it to
"--scriptsdir $scriptsdir" only if $scriptsdir exist.  That would let
the wrapper works properly whenever the scriptdir is empty by simply
discarding the option, but still quoting it properly when it is set.

Change-Id: I48c8e86ac007108ca6b650673087160a99d18a21
Lock access to conf/incoming file

With really bad timing we might run into something like this:

| + sudo reprepro -v -b /srv/repository/release/release-42-rc1 --waitforlock 1000 --ignore=wrongdistribution processincoming release-42-rc1 foo_23.1_amd64.changes
| Multiple definitions of 'release-42-rc1': first started at line 2 of /srv/repository/release/release-42-rc1/conf/incoming, second at line 11 of /srv/repository/release/release-42-rc1/conf/incoming!

Use flock(1) from util-linux to lock access to the
conf/incoming file.

Closes: MT#4751
Development sponsored by Sipwise GmbH
Allow debian-glue to read gbp.conf

For generate-git-snapshot, try read upstream branch, debian branch, and
status of pristine tar.
build-and-provide-package: get rid of dependency on dcmd

When running via PROVIDE_ONLY the build-and-provide-package would need
the dcmd from devscripts, but we'd like to avoid dependency on devscripts
for repository hosting hosts. Since dcmd is quite a trivial script overall
let's just replace it with our own code.
Rework new gbp.conf handling

In commit 9d5366f9db7 the gbp_opts function was reused, so rename
it to gbp_conf instead. Also do not fail if 'git config --file ...'
calls fail.

Additionally support the IGNORE_GBP_CONF setting to allow skipping
execution of gbp_conf.
Provide yaml setup files for usage with jenkins-job-builder

NOTE: I've filed a report against upstream's BTS to (hopefully)
get a new release of jenkins-job-builder, see
https://bugs.launchpad.net/openstack-ci/+bug/1251201
In the meanwhile be aware that the unsupported settings
(see jjb/README for details) are just ignored.

The piuparts job currently doesn't work out-of-the-box when set up
via jenkins-job-builder without the patch from
https://review.openstack.org/#/c/56412/ because the CopyArtifact
plugin applies a rewrite of the config.xml on first *build* of
the Jenkins job.
freight: support sudo for creating directories/conffile, extend config, quote all variables
jjb: adjust lintian call for binary job + make repository_checker dynamic
Provide simple gateway service between GitHub + (internal) Jenkins system

github/hook_server.rb provides a simple demo gateway between GitHub
and an (internal) Jenkins server to receive Git push actions from
GitHub and trigger Jenkins jobs accordingly. Place this script on
a host which is available from GitHub and also has access to the
(internal) Jenkins system.

Development sponsored by Sipwise.com
Add fakeroot to Depends

dpkg-buildpackage needs the fakeroot, otherwise fails with:

| + dpkg-buildpackage -uc -us -nc -d -S -i -I --source-option=--unapply-patches
| dpkg-buildpackage: error: fakeroot not found, either install the fakeroot
| package, specify a command with the -r option, or run this as root
| Build step 'Execute shell' marked build as failure
generate-*-snapshot: provide user friendly error message if debian/changelog is missing
generate-reprepro-codename: lock access to conf/distributions

With bad timing we might run into something like this:

| + grep -q '^Codename: release-mr3.2$' /srv/repository/release/release-mr3.2/conf/distributions
| + echo 'Codename/repository release-mr3.2 exists already, ignoring request to add again.'
| Codename/repository release-mr3.2 exists already, ignoring request to add again.

Use flock(1) from util-linux to lock access to the
reprepro configuration file.

Related to commit 14f3559a
Closes: MT#4751
Development sponsored by Sipwise GmbH
Don't include sources in sources.list, they're not needed for building

It's also not guaranteed that there even is a source repository.
The given $REPOS variable may also point to a suite, not only a codename

Reprepro accepts suite names as aliases for codenames so we should do so too.
Dynamically parse list of components from Release file

There's no need to hardcode "main".
Make it possible to verify our own reprepro repositories by providing a pubkey.

Verifying the integrity of our repository is basically mandatory when the
build server is separated from the repository server. Additionally, if you
want to build a package for Squeeze that has a dependency on a package from
our repository the package list *MUST* be verified because "[trusted=yes]" in
the sources list is not yet supported by that apt version.
puppet: install ttf-dejavu package to fix java headless issue

Jenkins/Java with OpenJDK might complain about:

| "Caused by: java.lang.Error: Probable fatal error:No fonts found."

and e.g. the "Test Result Trend" graphics are missing then.

Might also require:

  JAVA_ARGS="-Djava.awt.headless=true"

inside /etc/default/jenkins. The latest Jenkins packages
already include this, but it's missing in the LTS releases
currently, jftr.
puppet: install timestamper plugin

Every Jenkins system should have this plugin present,
so let's go for it.
build-and-provide-package: use -b for package builds that shouldn't include sources

See dpkg-buildpackage(1):

| -b  Specifies a binary-only build, no source files are to be built and/or distributed. Passed to dpkg-genchanges.

 vs.

| -B  Specifies a binary-only build, limited to architecture dependent packages.  Passed to dpkg-genchanges.

We don't want to skip the architecture dependent packages but
just don't want to include sources in all the package builds
(since the sources can be included via reprepro in the repository
just *once*).

Thanks: alexander (user systemstart on github) for testing and feedback