Use release repo for all builds with same release parameter.

When building release with dependencies between a bunch of new
packages they can't be satisfied from the default sources list as they
are not published yet. By adding release repo for each subsequent
build we solve this problem.
puppet: install git-client plugin by default

https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin needs
to be available (at least currently) so the git plugin works.
Depend on subversion-tools (<= 1.6.18dfsg-1) *or* svn2cl

svn2cl is no longer available in the unstable version of
subversion-tools, instead it's provided as separate package
as of subversion-tools 1.7.5-1.

Closes #45
use a more sensible default for DEBEMAIL
puppet: allow DEB_* environment variables in sudo configuration

Related to issue #46
puppet: use wget instead of curl as fallback for public IP retrieval

curl isn't present on Debian's AMI out-of-the-box.
Add the management of a PRE_SOURCE_HOOK variable. If set, the script pointed by PRE_SOURCE_HOOK will be executed before the .dsc creation
puppet: do not install xunit plugin by default

Junit is available out-of-the-box in Jenkins and our configuration
actually uses that, so there's no point in installing the xunit
plugin by default.

Verified on fresh Ubuntu 12.04 EC2 system.

Thanks: Sylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>
for bringing this up in https://github.com/mika/jenkins-debian-glue.org/pull/4
Allow removal of packages from releases

By default, if building a package for a release, it is assumed, that
this version has never been part of the release. Thus building the same
version again will fail, since reprepro will not allow adding this.
This patch adds a new option REMOVE_FROM_RELEASE which will force a
removal of the package from a release prior to incoming processing,
which may be useful in some cases (e.g. wanted rebuilds of releases)
Bugfix: Make dpkg-source ignore .git in more cases

In some cases the '-I' param to dpkg-source is not enough. In this case
builds fail since dpkg-source complains about modified files.
This additionally adds (previously used) '-i' to the params, which
fixes those cases.
Merge pull request #52 from credativ/bugfix/dpkg-source-not-ignoring-git

Bugfix: Make dpkg-source ignore .git in more cases
Change timestamp format used in version string

The timestamp YYYYMMDDhhmmss sorts equally well as unix timestamp and
yet it is much more usable for human beings.
generate-git-snapshot: force switching back to previous branch

At least when using the 3.0 quilt format in a Debian package there
might be changes left around in the working directory after
dpkg-source's execution:

| + dpkg-source -i -I -b source
| dpkg-source: info: using source format `3.0 (quilt)'
| dpkg-source: warning: patches have not been applied, applying them now (use --no-preparation to override)
| dpkg-source: info: applying 0001-Added-assertTrue-assertFalse-and-assertNotEquals-fun.patch
| dpkg-source: info: applying 0002-Fix-typo.patch
| dpkg-source: info: applying 0003-Added-assertItemsEquals-function.patch
| dpkg-source: info: building lua-unit using existing ./lua-unit_1.5.orig.tar.gz
| dpkg-source: info: building lua-unit in lua-unit_1.5-1~bpo70+1+0~1368438751.21+wheezy~1.gbp63ac0c.debian.tar.gz
| dpkg-source: info: building lua-unit in lua-unit_1.5-1~bpo70+1+0~1368438751.21+wheezy~1.gbp63ac0c.dsc
| ++ readlink -f debian/changelog
| + git checkout -- /var/lib/jenkins/workspace/lua-unit-source/source/debian/changelog
| + git checkout origin/pristine-tar
| error: You have local changes to 'luaunit.lua'; cannot switch branches.
| Build step 'Execute shell' marked build as failure

So avoid failing builds because of that and force switching
branch.
Merge remote-tracking branch 'origin/pr/51'

https://github.com/mika/jenkins-debian-glue/pull/51
Merge remote-tracking branch 'origin/pr/48'

https://github.com/mika/jenkins-debian-glue/pull/48
Merge remote-tracking branch 'origin/pr/56'

https://github.com/mika/jenkins-debian-glue/pull/56
generate-reprepro-codename: do not fail build if chown of reprepro conf fails [Closes #53]
Ship examples/debian_glue as /etc/jenkins/debian_glue default configuration file [Closes: #49]
generate-*-snapshot: do not fail if PRE_SOURCE_HOOK is unset

While at it adjust coding style
generate-git-snapshot: use --git-ignore-branch as default build option for gbp [Closes #47]

Reported in https://github.com/mika/jenkins-debian-glue/issues/47

Compare:

| % git-buildpackage -nc --git-force-create --git-ignore-new -S -us -uc --git-verbose --git-builder=/bin/true --git-cleaner=/bin/true
| gbp:debug: ['git', 'rev-parse', '--show-cdup']
| gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
| gbp:debug: /bin/true [] []
| gbp:debug: ['git', 'symbolic-ref', 'HEAD']
| gbp:error: Currently not on a branch

with:

| % git-buildpackage -nc --git-force-create --git-ignore-new -S -us -uc --git-verbose --git-builder=/bin/true --git-cleaner=/bin/true --git-ignore-branch
| gbp:debug: ['git', 'rev-parse', '--show-cdup']
| gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
| gbp:debug: /bin/true [] []
| gbp:debug: ['git', 'symbolic-ref', 'HEAD']
| gbp:debug: ['git', 'show-ref', 'refs/heads/pristine-tar']
| gbp:debug: ['git', 'ls-tree', 'upstream/1.7.4']
| gbp:error: upstream/1.7.4 is not a valid treeish

using a recent git-buildpackage version.

The --git-ignore-branch option allows to build packages
from detached HEAD state, also see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661598

As the option is already present (at least) in gbp 0.5.10
this should be a safe way how to prevent problems with
recent versions of gbp.

Verified against git-buildpackage 0.6.0~git20130506 and 0.5.10.