Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1379)

Unified Diff: archive_build.sh

Issue 2852033: Archive debug artifacts - take two (Closed) Base URL: ssh://git@chromiumos-git//crosutils.git
Patch Set: Reapply gsutil fix Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: archive_build.sh
diff --git a/archive_build.sh b/archive_build.sh
index 47847c00dc96fa8aee52ea426b5406ca5b5900a0..32986a8bae1ac4a67973896ec4e71d7b85a5b7f5 100755
--- a/archive_build.sh
+++ b/archive_build.sh
@@ -20,23 +20,20 @@ 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 gsd_gen_index "" \
@@ -45,6 +42,11 @@ DEFINE_string acl "private" \
"ACL to set on GSD archives"
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
@@ -188,7 +190,7 @@ chmod 755 "$OUTDIR"
function gsutil_archive() {
IN_PATH="$1"
OUT_PATH="$2"
- if [ $FLAGS_gsutil_archive != "" ]
+ if [ -n "$FLAGS_gsutil_archive" ]
then
FULL_OUT_PATH="${FLAGS_gsutil_archive}/${OUT_PATH}"
echo "Using gsutil to archive to ${OUT_PATH}..."
@@ -215,6 +217,17 @@ then
"${LAST_CHANGE}/${HWQUAL_NAME}.tar.bz2"
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
+
gsutil_archive "${ZIPFILE}" "${LAST_CHANGE}/${FLAGS_zipname}"
if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \
[ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698