Add debug.tgz debug info archive as buildbot artifact

BUG=4263

Review URL: http://codereview.chromium.org/2852022
This commit is contained in:
Ken Mixter 2010-06-29 12:42:51 -07:00
parent d72ebe7050
commit 428e195dbe

View File

@ -20,27 +20,29 @@ DEFAULT_FROM="${IMAGES_DIR}/$DEFAULT_BOARD/$(ls -t1 \
$IMAGES_DIR/$DEFAULT_BOARD 2>&-| head -1)"
# Flags
DEFINE_boolean archive_debug $FLAGS_TRUE \
"Archive debug information for build"
DEFINE_string board "$DEFAULT_BOARD" \
"The board to build packages for."
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
"The chroot of the build to archive."
DEFINE_string from "$DEFAULT_FROM" \
"Directory to archive"
DEFINE_string to "$DEFAULT_TO" "Directory of build archive"
DEFINE_integer keep_max 0 "Maximum builds to keep in archive (0=all)"
DEFINE_string zipname "image.zip" "Name of zip file to create."
DEFINE_boolean official_build $FLAGS_FALSE "Set CHROMEOS_OFFICIAL=1 for release builds."
DEFINE_string build_number "" \
"The build-bot build number (when called by buildbot only)." "b"
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
DEFINE_boolean factory_test_mod $FLAGS_FALSE \
"Modify image for factory testing purposes"
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
"The chroot of the build to archive."
DEFINE_boolean factory_install_mod $FLAGS_FALSE \
"Modify image for factory install purposes"
DEFINE_boolean factory_test_mod $FLAGS_FALSE \
"Modify image for factory testing purposes"
DEFINE_string from "$DEFAULT_FROM" \
"Directory to archive"
DEFINE_string gsutil "gsutil" \
"Location of gsutil"
DEFINE_string gsutil_archive "" \
"Optional datastore archive location"
DEFINE_integer keep_max 0 "Maximum builds to keep in archive (0=all)"
DEFINE_boolean official_build $FLAGS_FALSE "Set CHROMEOS_OFFICIAL=1 for release builds."
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
DEFINE_string to "$DEFAULT_TO" "Directory of build archive"
DEFINE_string zipname "image.zip" "Name of zip file to create."
# Parse command line
FLAGS "$@" || exit 1
@ -60,6 +62,9 @@ fi
# Die on any errors.
set -e
# Extend sudo timeout since we need it later.
sudo -v
if [ -z $DEFAULT_USED ] && [ $FLAGS_test_mod -eq $FLAGS_TRUE ]
then
echo "test_mod requires that the default from path be used."
@ -187,7 +192,7 @@ then
"${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \
--output_tag "${HWQUAL_NAME}"
# Optionally archive with gsutil hwqual.
if [ $FLAGS_gsutil_archive != "" ]
if [ "$FLAGS_gsutil_archive" != "" ]
then
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
GS_HWQUAL_IN="${OUTDIR}/${HWQUAL_NAME}.tar.bz2"
@ -197,8 +202,19 @@ then
fi
fi
if [ $FLAGS_archive_debug -eq $FLAGS_TRUE ]
then
echo "Creating debug archive"
pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/lib"
sudo tar czf "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \
--exclude debug/tests debug
CMD="chown \${SUDO_UID}:\${SUDO_GID} ${OUTDIR}/debug.tgz"
sudo sh -c "${CMD}"
popd
fi
# Optionally archive to Google Storage for Developers.
if [ $FLAGS_gsutil_archive != "" ]
if [ "$FLAGS_gsutil_archive" != "" ]
then
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
GS_ZIPFILE="${GS_OUTDIR}/${FLAGS_zipname}"