build-and-provide-package: support PROVIDE_ONLY and BUILD_ONLY, drop REMOTE_REPOS

Support setting PROVIDE_ONLY for skipping cowbuilder stage
and BUILD_ONLY for skipping reprepro repository stage.

Drop REMOTE_REPOS configuration variable, as the name actually
doesn't reflect what the script supports nor is it of any use
in the main configuration file when having PROVIDE_ONLY and
BUILD_ONLY available.

This provides the base for using $job-source, $job-binaries and
$job-repos to get the build process scaling and distributed on
specific slaves.
remotes/origin/mika/no_changes
Michael Prokop 13 years ago
parent ca5989e07a
commit 9247871839

@ -5,10 +5,6 @@
# Expected format: DEADBEEF # Expected format: DEADBEEF
# KEY_ID= # KEY_ID=
# Don't use local reprepro repository.
# Supported values: [true|false]
# REMOTE_REPOS=true
# If TRUNK_RELEASE is set then the package(s) of the repository # If TRUNK_RELEASE is set then the package(s) of the repository
# receiving the packages that are built will be copied to the # receiving the packages that are built will be copied to the
# repository specified in TRUNK_RELEASE. This provides the option # repository specified in TRUNK_RELEASE. This provides the option

@ -200,12 +200,12 @@ identify_build_type() {
if [ -z "${MAIN_ARCHITECTURE:-}" ] ; then if [ -z "${MAIN_ARCHITECTURE:-}" ] ; then
if [ "$(dpkg-architecture -qDEB_HOST_ARCH)" = "${architecture:-}" ] ; then if [ "$(dpkg-architecture -qDEB_HOST_ARCH)" = "${architecture:-}" ] ; then
echo "*** MAIN_ARCHITECTURE is unset. ***" echo "*** MAIN_ARCHITECTURE is unset. ***"
echo "*** Host architecture matches \$architecture, using default ${DEBBUILDOPTS} buildoption ***" echo "*** Host architecture matches \$architecture, using default ${DEBBUILDOPTS:-} buildoption ***"
return 0 return 0
fi fi
else else
if [ "${MAIN_ARCHITECTURE:-}" = "${architecture:-}" ] ;then if [ "${MAIN_ARCHITECTURE:-}" = "${architecture:-}" ] ;then
echo "*** MAIN_ARCHITECTURE matches architecture [${architecture}], using default ${DEBBUILDOPTS} buildoption ***" echo "*** MAIN_ARCHITECTURE matches architecture [${architecture:-}], using default ${DEBBUILDOPTS:-} buildoption ***"
return 0 return 0
else else
echo "*** MAIN_ARCHITECTURE does not match ${architecture:-}, continuing with identify_build_type ***" echo "*** MAIN_ARCHITECTURE does not match ${architecture:-}, continuing with identify_build_type ***"
@ -254,13 +254,13 @@ cowbuilder_run() {
i386) i386)
linux32 sudo cowbuilder --buildresult "$WORKSPACE"/binaries/ \ linux32 sudo cowbuilder --buildresult "$WORKSPACE"/binaries/ \
--build $sourcefile \ --build $sourcefile \
--basepath $BASE --debbuildopts "$DEBBUILDOPTS" --basepath $BASE --debbuildopts "${DEBBUILDOPTS:-}"
[ $? -eq 0 ] || bailout 1 "Error: Failed to build with cowbuilder." [ $? -eq 0 ] || bailout 1 "Error: Failed to build with cowbuilder."
;; ;;
amd64|all) amd64|all)
sudo cowbuilder --buildresult "$WORKSPACE"/binaries/ \ sudo cowbuilder --buildresult "$WORKSPACE"/binaries/ \
--build $sourcefile \ --build $sourcefile \
--basepath $BASE --debbuildopts "$DEBBUILDOPTS" --basepath $BASE --debbuildopts "${DEBBUILDOPTS:-}"
[ $? -eq 0 ] || bailout 1 "Error: Failed to build with cowbuilder." [ $? -eq 0 ] || bailout 1 "Error: Failed to build with cowbuilder."
;; ;;
*) *)
@ -297,7 +297,7 @@ remove_missing_binary_packages() {
# be reported as missing from the build and to be considered for removal. # be reported as missing from the build and to be considered for removal.
# As we don't want to remove the arch-all package e.g. from the amd64 repos # As we don't want to remove the arch-all package e.g. from the amd64 repos
# in the i386 run we've to skip the removal procedure then. # in the i386 run we've to skip the removal procedure then.
case "$DEBBUILDOPTS" in case "${DEBBUILDOPTS:-}" in
*-B*) *-B*)
echo "*** Skipping removal of missing binaries as being a binary-only build ***" echo "*** Skipping removal of missing binaries as being a binary-only build ***"
return 0 return 0
@ -396,9 +396,7 @@ EOF
} }
deploy_to_releases() { deploy_to_releases() {
if [ "${REMOTE_REPOS:-}" = "true" ] ; then if [ -n "${release:-}" ] && [ "$release" != "none" ] && [ "$release" != "trunk" ] ; then
echo "*** Config variable 'REMOTE_REPOS' is set, ignoring request to use local repository. ***"
elif [ -n "${release:-}" ] && [ "$release" != "none" ] && [ "$release" != "trunk" ] ; then
release_repos release_repos
else else
reprepro_wrapper reprepro_wrapper
@ -423,9 +421,22 @@ set_base_path
build_info build_info
identify_sourcefile identify_sourcefile
dist_and_arch_settings dist_and_arch_settings
# do not run in repos job?
if [ -n "${PROVIDE_ONLY:-}" ] ; then
echo "*** Config variable 'PROVIDE_ONLY' is set, ignoring request to run cowbuilder. ***"
else
cowbuilder_init cowbuilder_init
cowbuilder_run cowbuilder_run
fi
# do not run in binaries job?
if [ -n "${BUILD_ONLY:-}" ] ; then
echo "*** Config variable 'BUILD_ONLY' is set, ignoring request to use local repository. ***"
else
deploy_to_releases deploy_to_releases
fi
binaries_to_workspace binaries_to_workspace
bailout 0 bailout 0

@ -7,8 +7,8 @@ if [ -r /etc/jenkins/debian_glue ] ; then
. /etc/jenkins/debian_glue . /etc/jenkins/debian_glue
fi fi
if [ "${REMOTE_REPOS:-}" = "true" ] ; then if [ "${BUILD_ONLY:-}" = "true" ] ; then
echo "REMOTE_REPOS is set, ignoring request to generate local repository." echo "BUILD_ONLY is set to true, ignoring request to generate local repository."
exit 0 exit 0
fi fi

Loading…
Cancel
Save