mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-17 08:31:33 +01:00
Add debug.tgz debug info archive as buildbot artifact
BUG=4263 Review URL: http://codereview.chromium.org/2852022
This commit is contained in:
parent
d72ebe7050
commit
428e195dbe
@ -20,27 +20,29 @@ DEFAULT_FROM="${IMAGES_DIR}/$DEFAULT_BOARD/$(ls -t1 \
|
|||||||
$IMAGES_DIR/$DEFAULT_BOARD 2>&-| head -1)"
|
$IMAGES_DIR/$DEFAULT_BOARD 2>&-| head -1)"
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
|
DEFINE_boolean archive_debug $FLAGS_TRUE \
|
||||||
|
"Archive debug information for build"
|
||||||
DEFINE_string board "$DEFAULT_BOARD" \
|
DEFINE_string board "$DEFAULT_BOARD" \
|
||||||
"The board to build packages for."
|
"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 "" \
|
DEFINE_string build_number "" \
|
||||||
"The build-bot build number (when called by buildbot only)." "b"
|
"The build-bot build number (when called by buildbot only)." "b"
|
||||||
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
|
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
|
||||||
DEFINE_boolean factory_test_mod $FLAGS_FALSE \
|
"The chroot of the build to archive."
|
||||||
"Modify image for factory testing purposes"
|
|
||||||
DEFINE_boolean factory_install_mod $FLAGS_FALSE \
|
DEFINE_boolean factory_install_mod $FLAGS_FALSE \
|
||||||
"Modify image for factory install purposes"
|
"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" \
|
DEFINE_string gsutil "gsutil" \
|
||||||
"Location of gsutil"
|
"Location of gsutil"
|
||||||
DEFINE_string gsutil_archive "" \
|
DEFINE_string gsutil_archive "" \
|
||||||
"Optional datastore archive location"
|
"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
|
# Parse command line
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
@ -60,6 +62,9 @@ fi
|
|||||||
# Die on any errors.
|
# Die on any errors.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Extend sudo timeout since we need it later.
|
||||||
|
sudo -v
|
||||||
|
|
||||||
if [ -z $DEFAULT_USED ] && [ $FLAGS_test_mod -eq $FLAGS_TRUE ]
|
if [ -z $DEFAULT_USED ] && [ $FLAGS_test_mod -eq $FLAGS_TRUE ]
|
||||||
then
|
then
|
||||||
echo "test_mod requires that the default from path be used."
|
echo "test_mod requires that the default from path be used."
|
||||||
@ -187,7 +192,7 @@ then
|
|||||||
"${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \
|
"${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \
|
||||||
--output_tag "${HWQUAL_NAME}"
|
--output_tag "${HWQUAL_NAME}"
|
||||||
# Optionally archive with gsutil hwqual.
|
# Optionally archive with gsutil hwqual.
|
||||||
if [ $FLAGS_gsutil_archive != "" ]
|
if [ "$FLAGS_gsutil_archive" != "" ]
|
||||||
then
|
then
|
||||||
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
||||||
GS_HWQUAL_IN="${OUTDIR}/${HWQUAL_NAME}.tar.bz2"
|
GS_HWQUAL_IN="${OUTDIR}/${HWQUAL_NAME}.tar.bz2"
|
||||||
@ -197,8 +202,19 @@ then
|
|||||||
fi
|
fi
|
||||||
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.
|
# Optionally archive to Google Storage for Developers.
|
||||||
if [ $FLAGS_gsutil_archive != "" ]
|
if [ "$FLAGS_gsutil_archive" != "" ]
|
||||||
then
|
then
|
||||||
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
GS_OUTDIR="${FLAGS_gsutil_archive}/${LAST_CHANGE}"
|
||||||
GS_ZIPFILE="${GS_OUTDIR}/${FLAGS_zipname}"
|
GS_ZIPFILE="${GS_OUTDIR}/${FLAGS_zipname}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user