Commit deea1a1a authored by Franco Lanza's avatar Franco Lanza

Merge remote-tracking branch 'upstream/master'

parents 6a74ffa6 09a78f2e
jenkins-debian-glue (0.17.0+devuan1) unstable; urgency=medium
* Import latest changes from upstream
-- Franco (nextime) Lanza <nextime@devuan.org> Wed, 04 May 2016 07:28:13 +0100
jenkins-debian-glue (0.15.2+devuan5) unstable; urgency=low
* install pbuilder only for arm* archs
......
......@@ -4,7 +4,7 @@ Priority: extra
Maintainer: Franco (nextime) Lanza <nextime@devuan.org>
Build-Depends: debhelper (>= 8.0.0),
shunit2
Standards-Version: 3.9.6
Standards-Version: 3.9.7
Homepage: https://git.devuan.org/devuan-infrastructure/jenkins-devuan-glue
Vcs-Git: https://git.devuan.org/devuan-infrastructure/jenkins-devuan-glue.git
Vcs-Browser: https://git.devuan.org/devuan-infrastructure/jenkins-devuan-glue/tree/master
......@@ -20,9 +20,9 @@ Conflicts: jenkins-debian-glue-buildenv-git,
jenkins-debian-glue-buildenv-slave,
jenkins-debian-glue-buildenv-svn,
jenkins-debian-glue-buildenv-taptools
Description: glue scripts for building Debian packages inside Jenkins
This package provides scripts which should make building Debian
package inside Jenkins (a Continuous Integration suite) easier.
Description: Jenkins Debian glue scripts
This package provides scripts which make building Debian
packages inside Jenkins (a Continuous Integration suite) easier.
.
It's meant to make Q/A builds of Debian packages inside Jenkins
as manageable and homogeneous as possible.
......@@ -71,9 +71,13 @@ Recommends: curl,
pep8 (>= 1.4.6~),
qemu-user-static,
shellcheck
Description: Virtual package to be used on build slaves
This virtual package depends on the software packages required
for using jenkins-debian-glue as build environment.
Description: Jenkins Debian glue scripts - dependency package
This package depends on all Debian packaging/repository
management and VCS tools which may be used with
jenkins-debian-glue for easier installation.
.
If disk space is a concern consider installing only the subset
of packages you actually need.
Package: jenkins-debian-glue-buildenv-devuan
Architecture: all
......@@ -83,5 +87,3 @@ Depends: sudo,
Description: Devuan GNU/Linux support in jenkins debian glue
This package provides Devuan specific additional files
used for building Devuan packages.
......@@ -3,11 +3,11 @@ Upstream-Name: jenkins-debian-glue
Source: https://github.com/mika/jenkins-debian-glue
Files: *
Copyright: 2011-2015 Michael Prokop <mika@debian.org>
Copyright: 2011-2016 Michael Prokop <mika@debian.org>
License: MIT
Files: debian/*
Copyright: 2011-2015 Michael Prokop <mika@debian.org>
Copyright: 2011-2016 Michael Prokop <mika@debian.org>
License: MIT
Files: pbuilder-hookdir/B20autopkgtest
......
......@@ -33,7 +33,13 @@ EOF
exit 1
fi
cd /tmp/buildd/*/debian/..
if [ -d /build ] ; then
BUILD_DIR="/build" # pbuilder >=0.216
else
BUILD_DIR="/tmp/buildd" # pbuilder <0.216
fi
cd "${BUILD_DIR}"/*/debian/..
ID="$(basename $PWD)"
touch /testfile.$$
......@@ -58,7 +64,7 @@ cat <<EOF
│ chroot /var/cache/pbuilder/build/debug.$ID
│ su - pbuilder
│ bash
│ cd /tmp/buildd/*/debian/..
│ cd ${BUILD_DIR}/*/debian/..
│ env PATH="/usr/sbin:/usr/bin:/sbin:/bin" dpkg-buildpackage -us -uc -nc -rfakeroot
┌──────────────────────────────────────────────────────────────────────────────┐
......
......@@ -21,6 +21,7 @@ if [ -d "$TMPAPT" ]; then
echo "Using keyring for additional apt sources."
cp "${TMPAPT}/keyring.gpg" /etc/apt/trusted.gpg.d
chmod 0644 /etc/apt/trusted.gpg.d/keyring.gpg
fi
if [ "$UPDATE_PKGLIST" = 1 ]; then
......
......@@ -86,7 +86,7 @@ class jenkins::repos {
file { '/etc/apt/sources.list.d/jenkins.list':
ensure => present,
notify => Exec['refresh-apt-jenkins'],
content => 'deb http://pkg.jenkins-ci.org/debian-stable binary/',
content => "deb http://pkg.jenkins-ci.org/debian-stable binary/\n",
require => Apt::Key['D50582E6'],
}
......@@ -108,7 +108,7 @@ class jenkins::repos {
file { '/etc/apt/sources.list.d/jenkins-debian-glue.list':
ensure => present,
notify => Exec['refresh-apt-jenkins-debian-glue'],
content => 'deb http://jenkins.grml.org/debian jenkins-debian-glue main',
content => "deb http://jenkins.grml.org/debian jenkins-debian-glue main\n",
require => Apt::Key['52D4A654'],
}
......@@ -136,6 +136,16 @@ class jenkins::software {
require => Package['jenkins'],
}
# required for recent versions of credentials
jenkins::plugin::install { 'icon-shim':
require => Package['jenkins'],
}
# required for recent versions of credentials
jenkins::plugin::install { 'ssh-credentials':
require => Package['jenkins'],
}
jenkins::plugin::install { 'git-client':
require => Package['jenkins'],
}
......@@ -154,6 +164,11 @@ class jenkins::software {
require => Package['jenkins'],
}
# required for recent versions of ssh-agent
jenkins::plugin::install { 'workflow-step-api':
require => Package['jenkins'],
}
jenkins::plugin::install { 'tap':
require => Package['jenkins'],
}
......
......@@ -109,6 +109,9 @@ checks_and_defaults() {
echo "*** REPREPRO_OPTS is unset, using default: $REPREPRO_OPTS ***"
fi
# support usage of a reprepro wrapper
REPREPRO_CMD="${REPREPRO_CMD:-reprepro}"
if [ -z "${DEFAULT_REPOSITORY:-}" ] ; then
DEFAULT_REPOSITORY='/srv/repository'
fi
......@@ -814,7 +817,7 @@ remove_packages() {
fi
echo "*** Removing source package version from repository ***"
${SUDO_CMD:-} reprepro -A source -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${SOURCE_PACKAGE}"
${SUDO_CMD:-} ${REPREPRO_CMD} -A source -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${SOURCE_PACKAGE}"
echo "*** Removing previous binary package versions from repository ***"
for p in $(list_deb_files "${WORKSPACE}/binaries/"*"_${newest_version}_${arch}.changes") ; do
......@@ -838,10 +841,10 @@ remove_packages() {
elif echo "$file" | egrep -q '_all.deb$'; then
# note: "removesrc" would remove foreign arch files (of different builds)
echo "*** Removing existing package ${binpackage} from repository ${REPOS} (arch all) ***"
${SUDO_CMD:-} reprepro -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${binpackage}"
${SUDO_CMD:-} ${REPREPRO_CMD} -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${binpackage}"
else
echo "*** Removing existing package ${binpackage} from repository ${REPOS} for arch ${arch} ***"
${SUDO_CMD:-} reprepro -A "${arch}" -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${binpackage}"
${SUDO_CMD:-} ${REPREPRO_CMD} -A "${arch}" -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${binpackage}"
fi
done
......@@ -849,8 +852,8 @@ remove_packages() {
}
remove_missing_binary_packages() {
if [ -n "${SKIP_REMOVAL:-}" ] ; then
echo "*** Skipping removal of existing packages as requested via SKIP_REMOVAL ***"
if [ -n "${SKIP_MISSING_BINARY_REMOVAL:-${SKIP_REMOVAL:-}}" ] ; then
echo "*** Skipping removal of existing packages as requested via SKIP_MISSING_BINARY_REMOVAL or SKIP_REMOVAL ***"
return 0
fi
......@@ -868,7 +871,7 @@ remove_missing_binary_packages() {
;;
esac
for p in $(${SUDO_CMD:-} reprepro -b "${REPOSITORY}" ${REPREPRO_OPTS} --list-format '${package}\n' listmatched "${REPOS}" '*' | sort -u); do
for p in $(${SUDO_CMD:-} ${REPREPRO_CMD} -b "${REPOSITORY}" ${REPREPRO_OPTS} --list-format '${package}\n' listmatched "${REPOS}" '*' | sort -u); do
echo " $binary_list " | grep -q " $p " || missing_packages="${missing_packages:-} $p"
done
......@@ -891,7 +894,7 @@ remove_missing_binary_packages() {
echo "*** Package '$p' listed in SKIP_PACKAGE_FROM_REMOVAL - skipping removal therefore ***"
else
echo "*** Removing $p from $REPOS to avoid out-of-date data ***"
${SUDO_CMD:-} reprepro -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${p}"
${SUDO_CMD:-} ${REPREPRO_CMD} -b "${REPOSITORY}" ${REPREPRO_OPTS} remove "${REPOS}" "${p}"
fi
done
......@@ -916,8 +919,8 @@ reprepro_wrapper() {
esac
echo "*** Including packages in repository $REPOS ***"
${SUDO_CMD:-} reprepro -b "${REPOSITORY}" ${REPREPRO_OPTS} \
--ignore=wrongdistribution --ignore=uploaders \
${SUDO_CMD:-} ${REPREPRO_CMD} -b "${REPOSITORY}" ${REPREPRO_OPTS} \
--ignore=wrongdistribution --ignore=uploaders --ignore=surprisingbinary \
include "${REPOS}" "${WORKSPACE}/binaries/"*"_${newest_version}"_${architecture}.changes
[ $? -eq 0 ] || bailout 1 "Error: Failed to include binary package in $REPOS repository."
}
......@@ -997,7 +1000,7 @@ trunk_release() {
${SUDO_CMD:-} generate-reprepro-codename "$TRUNK_RELEASE"
${SUDO_CMD:-} reprepro -b "${REPOSITORY}" ${REPREPRO_OPTS} --ignore=wrongdistribution copymatched "$TRUNK_RELEASE" "$REPOS" '*'
${SUDO_CMD:-} ${REPREPRO_CMD} -b "${REPOSITORY}" ${REPREPRO_OPTS} --ignore=wrongdistribution copymatched "$TRUNK_RELEASE" "$REPOS" '*'
[ $? -eq 0 ] || bailout 1 "Error: Failed to copy packages from ${REPOS} to ${TRUNK_RELEASE}."
fi
}
......@@ -1034,13 +1037,19 @@ drop_unused_debfiles() {
release_repos() {
echo "*** Environment variable 'release' is set, running through release steps. ***"
# if codename should be different from release
if [ -z "${RELEASE_DISTRIBUTION:-}" ] ; then
RELEASE_DISTRIBUTION="$release"
echo "*** Environment variable 'RELEASE_DISTRIBUTION' is unset, defaulting to $RELEASE_DISTRIBUTION ***"
fi
if [ -n "${RELEASE_REPOSITORY:-}" ]; then
local REPOSITORY="${RELEASE_REPOSITORY}"
else
local REPOSITORY="${REPOSITORY}/release/${release}"
fi;
mkdir -p "${REPOSITORY}/incoming/${release}"
mkdir -p "${REPOSITORY}/incoming/${RELEASE_DISTRIBUTION}"
mkdir -p "${REPOSITORY}/conf"
if [ "${REMOVE_FROM_RELEASE:-}" = 'true' ]; then
......@@ -1051,25 +1060,25 @@ release_repos() {
# get rid of files that aren't mentioned in the changes files before copying to incoming directory
drop_unused_debfiles
cp "${WORKSPACE}/binaries/"* "${REPOSITORY}/incoming/${release}/"
cp "${WORKSPACE}/binaries/"* "${REPOSITORY}/incoming/${RELEASE_DISTRIBUTION}/"
[ $? -eq 0 ] || bailout 1 "Error: Failed to copy binary packages to release directory."
REPOSITORY=$REPOSITORY generate-reprepro-codename "${release}"
REPOSITORY=$REPOSITORY generate-reprepro-codename "${RELEASE_DISTRIBUTION}"
# lock access to file to avoid duplicate entries when two build-and-provide-package
# runs happen at the very same time with regard to conf/incoming setup
(
flock --timeout 5 9 || bailout 1 "Error: could not lock file ${REPOSITORY}/conf/incoming, giving up."
if ! grep -q "^Name: $release$" "${REPOSITORY}/conf/incoming" 2>/dev/null ; then
if ! grep -q "^Name: $RELEASE_DISTRIBUTION$" "${REPOSITORY}/conf/incoming" 2>/dev/null ; then
cat >> "${REPOSITORY}/conf/incoming" << EOF
Name: $release
IncomingDir: incoming/$release
Name: ${RELEASE_DISTRIBUTION}
IncomingDir: incoming/${RELEASE_DISTRIBUTION}
TempDir: tmp
LogDir: log
MorgueDir: ${REPOSITORY}/morgue
Default: $release
Default: ${RELEASE_DISTRIBUTION}
Cleanup: unused_files on_deny on_error
EOF
......@@ -1077,9 +1086,9 @@ EOF
) 9>/var/lock/jdg-build-and-provide-incoming."$(id -un)" || bailout 1 "Error while setting up incoming repository."
local old_dir=$(pwd)
cd "${REPOSITORY}/incoming/${release}"
${SUDO_CMD:-} reprepro -b "${REPOSITORY}" ${REPREPRO_OPTS} --ignore=wrongdistribution \
processincoming "${release}" "$(basename ${WORKSPACE}/binaries/*.changes)"
cd "${REPOSITORY}/incoming/${RELEASE_DISTRIBUTION}"
${SUDO_CMD:-} ${REPREPRO_CMD} -b "${REPOSITORY}" ${REPREPRO_OPTS} --ignore=wrongdistribution \
processincoming "${RELEASE_DISTRIBUTION}" "$(basename ${WORKSPACE}/binaries/*.changes)"
local RC=$?
cd "$old_dir"
......@@ -1114,7 +1123,16 @@ deploy_to_releases() {
# setting the predefined parameters therefore) then ${release} is set to
# '${release}' instead of being empty
[ "${release}" != '${release}' ] ; then
release_repos
if [ -z "${RELEASE_REPOSITORIES:-}" ] ; then
release_repos
else
# allow pushing packages to multiple release repositories, like:
# RELEASE_REPOSITORIES="/srv/repository/release/ce/${release} /srv/repository/release/pro/${release}"
for release_repository in ${RELEASE_REPOSITORIES:-} ; do
RELEASE_REPOSITORY="$release_repository" release_repos
done
fi
else
reprepro_wrapper
trunk_release
......
......@@ -235,7 +235,7 @@ identify_latest_change() {
fi
echo "Latest tag [${last_tag:-}] / merge [${last_merge:-}] seems to be $since"
${GBP_DCH} -s "${since}" $DCH_COMBINED_OPTS
${GBP_DCH} -s "${since}" $DCH_COMBINED_OPTS ${DCH_CHANGELOG_FILE:-}
local NEW_VERSION=$(dpkg-parsechangelog | awk '/^Version: / {print $2}')
......@@ -416,10 +416,10 @@ source_format_opts() {
;;
'3.0 (git)')
echo "*** Source format detected as 3.0 (git) ***"
git_source_options
PRISTINE_TAR=false
SKIP_QUILT_CLEANUP=true
IGNORE_GIT_BUILDPACKAGE=true
git_source_options
;;
'3.0 (native)')
echo "*** Source format detected as 3.0 (native) ***"
......
......@@ -35,6 +35,9 @@ if [ -z "${REPOSITORY:-}" ] ; then
echo "*** Repository variable REPOSITORY is unset, using default [$REPOSITORY] ***"
fi
# support usage of a reprepro wrapper
REPREPRO_CMD="${REPREPRO_CMD:-reprepro}"
if [ -z "${REPREPRO_OPTS:-}" ] ; then
REPREPRO_OPTS='--waitforlock 1000 -v'
fi
......@@ -60,6 +63,6 @@ echo "*** Removing codename $codename from reprepro configuration in $REPOSITORY
perl -i -00 -pe "if (!\$done && m|$codename|) { \$_=q(); \$done++}" "${REPOSITORY}/conf/distributions"
echo "*** Removing vanished data from reprepro ***"
reprepro $REPREPRO_OPTS -b "$REPOSITORY" --delete clearvanished
${REPREPRO_CMD} $REPREPRO_OPTS -b "$REPOSITORY" --delete clearvanished
# vim:foldmethod=marker ts=2 ft=sh ai expandtab sw=2
......@@ -33,6 +33,9 @@ if [ -z "${REPOSITORY:-}" ] ; then
echo "*** Repository variable REPOSITORY is unset, using default [$REPOSITORY] ***"
fi
# support usage of a reprepro wrapper
REPREPRO_CMD="${REPREPRO_CMD:-reprepro}"
if [ -z "${REPREPRO_OPTS:-}" ] ; then
REPREPRO_OPTS='--waitforlock 1000 -v'
fi
......@@ -126,20 +129,20 @@ validate-source-bin-versions() {
rc=0
for repository in $(awk '/^Codename: / {print $2}' "${REPOSITORY}"/conf/distributions 2>"${LOGFILE}") ; do
for sourcepackage in $(reprepro $REPREPRO_OPTS -A source -b "${REPOSITORY}" --list-format='${package}\n' list $repository 2>"${LOGFILE}") ; do
for sourcepackage in $(${REPREPRO_CMD} $REPREPRO_OPTS -A source -b "${REPOSITORY}" --list-format='${package}\n' list $repository 2>"${LOGFILE}") ; do
if $_opt_validate_skip_package && _skip_package "${SKIP_PACKAGE}" "$sourcepackage" ; then
echo "skipping: $sourcepackage"
continue
fi
sourceversion=$(reprepro $REPREPRO_OPTS -A source -b "${REPOSITORY}" --list-format='${version}\n' list $repository $sourcepackage 2>"${LOGFILE}")
for binarypackage in $(reprepro $REPREPRO_OPTS -b "${REPOSITORY}" --list-format='${package}\n' -T deb listfilter "$repository" "\$Source (==$sourcepackage)" 2>"${LOGFILE}") ; do
sourceversion=$(${REPREPRO_CMD} $REPREPRO_OPTS -A source -b "${REPOSITORY}" --list-format='${version}\n' list $repository $sourcepackage 2>"${LOGFILE}")
for binarypackage in $(${REPREPRO_CMD} $REPREPRO_OPTS -b "${REPOSITORY}" --list-format='${package}\n' -T deb listfilter "$repository" "\$Source (==$sourcepackage)" 2>"${LOGFILE}") ; do
if $_opt_validate_skip_package && _skip_package "${SKIP_PACKAGE}" "$binarypackage" ; then
echo "skipping: $binarypackage"
continue
fi
archversion=$(reprepro $REPREPRO_OPTS -A amd64 -b "${REPOSITORY}" --list-format='${version}\n' list $repository $binarypackage 2>"${LOGFILE}")
archversion=$(${REPREPRO_CMD} $REPREPRO_OPTS -A amd64 -b "${REPOSITORY}" --list-format='${version}\n' list $repository $binarypackage 2>"${LOGFILE}")
if $_opt_version_remove_epoch ; then
sourceversion=$(_remove_epoch $sourceversion)
......@@ -256,32 +259,32 @@ fi
# main execution
if $_opt_list_packages ; then
reprepro ${REPREPRO_OPTS} -b "${REPOSITORY}" ls "${PACKAGE}"
${REPREPRO_CMD} ${REPREPRO_OPTS} -b "${REPOSITORY}" ls "${PACKAGE}"
bailout 0
fi
if $_opt_list_source_package ; then
reprepro ${REPREPRO_OPTS} -b "${REPOSITORY}" -A source ls "${PACKAGE}"
${REPREPRO_CMD} ${REPREPRO_OPTS} -b "${REPOSITORY}" -A source ls "${PACKAGE}"
bailout 0
fi
if $_opt_list_binary_package ; then
reprepro ${REPREPRO_OPTS} -b "${REPOSITORY}" -T deb ls "${PACKAGE}"
${REPREPRO_CMD} ${REPREPRO_OPTS} -b "${REPOSITORY}" -T deb ls "${PACKAGE}"
bailout 0
fi
if $_opt_list_repos ; then
reprepro ${REPREPRO_OPTS} -b "${REPOSITORY}" list "${REPOS}"
${REPREPRO_CMD} ${REPREPRO_OPTS} -b "${REPOSITORY}" list "${REPOS}"
bailout 0
fi
if $_opt_list_source_repos ; then
reprepro ${REPREPRO_OPTS} -b "${REPOSITORY}" -A source list "${REPOS}"
${REPREPRO_CMD} ${REPREPRO_OPTS} -b "${REPOSITORY}" -A source list "${REPOS}"
bailout 0
fi
if $_opt_list_binary_repos ; then
reprepro ${REPREPRO_OPTS} -b "${REPOSITORY}" -T deb list "${REPOS}"
${REPREPRO_CMD} ${REPREPRO_OPTS} -b "${REPOSITORY}" -T deb list "${REPOS}"
bailout 0
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment