...
 
Commits (2)
......@@ -4,10 +4,10 @@
. "$(dirname "$(readlink -f "$0")")"/functions-common.sh
detect_project() {
dists=( "$(grep -E ^Source: ./*/debian/control | awk '{print $2}' | sort -u)" )
dists=( "$(grep -E ^Source: ./debian/control ./*/debian/control 2>/dev/null | awk '{print $2}' | sort -u)" )
if [ "${#dists[@]}" -eq 0 ]; then
echo "No Debian control files found!" >&2
echo "No Debian control files found: ./debian/control ./*/debian/control" >&2
exit 1
elif [ "${#dists[@]}" -gt 1 ]; then
echo "More than one Source names found in Debian control files!" >&2
......
......@@ -18,11 +18,20 @@ echo "[ git status ]"
GIT_PAGER='cat' git status || true
echo
# creating project directory
echo "[ Creating Build Environment ]"
if [ -d "${ICINGA_BUILD_DEB_FLAVOR}" ]; then
debian_scripts="./${ICINGA_BUILD_DEB_FLAVOR}/debian"
elif [ -d debian ]; then
debian_scripts="./debian"
else
echo "Could not find any Debian packaging scripts for flavor ${ICINGA_BUILD_DEB_FLAVOR}!" >&2
exit 1
fi
(
set -ex
mkdir "${BUILDDIR}" "${BUILDDIR}/${ICINGA_BUILD_PROJECT}"
cp -r ./"${ICINGA_BUILD_DEB_FLAVOR}"/debian "${BUILDDIR}/${ICINGA_BUILD_PROJECT}"/
cp -r "${debian_scripts}" "${BUILDDIR}/${ICINGA_BUILD_PROJECT}"/
)
# download archive
......
......@@ -2,7 +2,7 @@
# detecting files
FILES_SPEC="$(ls ./*.spec 2>/dev/null)"
FILES_DEBIAN="$(ls -d ./*/debian 2>/dev/null)"
FILES_DEBIAN="$(ls -d ./debian ./*/debian 2>/dev/null)"
if [ -n "${FILES_SPEC}" ]; then
echo "Detected RPM source: ${FILES_SPEC}"
......@@ -21,7 +21,7 @@ if [ -n "${FILES_SPEC}" ]; then
fi
echo "[ binary build completed ]"
elif [ -n "${FILES_DEBIAN}" ]; then
echo "Detected Debian source files: ${FILES_DEBIAN}"
echo "Detected Debian packaging paths: ${FILES_DEBIAN}"
echo
echo "[ running source build ]"
if ! icinga-build-deb-source; then
......
#!/bin/bash
declare -i retries=3
declare -i timeout=30
declare -i timeout=120
declare -i interval=1
declare -i delay=1
declare -i wait=15
while getopts ":t:i:d:r:" option; do
while getopts ":t:i:d:r:w:" option; do
case "$option" in
t) timeout=$OPTARG ;;
i) interval=$OPTARG ;;
d) delay=$OPTARG ;;
r) retries=$OPTARG ;;
w) retries=$OPTARG ;;
*) run-timeout -h; exit 1 ;;
esac
done
......@@ -27,7 +29,8 @@ fi
while ((r > 0)); do
run-timeout -t "$timeout" -i "$interval" -d "$delay" "$@" && exit 0
((r -= 1))
sleep "$delay"
echo "Waiting $wait seconds before retry"
sleep "$wait"
done
echo "Command failed on all $retries retries!" >&2
......