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

Unified Diff: archive_build.sh

Issue 6508011: Add tarball option and print out what gsutil would do to make it easier to debug. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: One more time Created 9 years, 10 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 f1c75c7b30b4dc2973e3f8f3a91c80eabbb7278d..121b7c73f5a09e33b5b954c5cd009820595a36bc 100755
--- a/archive_build.sh
+++ b/archive_build.sh
@@ -45,6 +45,7 @@ DEFINE_string build_number "" \
"The build-bot build number (when called by buildbot only)." "b"
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
"The chroot of the build to archive."
+DEFINE_boolean debug $FLAGS_FALSE "Run, but don't upload anything."
DEFINE_boolean factory_install_mod $FLAGS_FALSE \
"Modify image for factory install purposes"
DEFINE_boolean factory_test_mod $FLAGS_FALSE \
@@ -62,6 +63,7 @@ DEFINE_string gsutil_archive "" \
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_string test_tarball "" "Optional path to test tarball to archive"
DEFINE_boolean test_mod $FLAGS_TRUE "Modify image for testing purposes"
DEFINE_boolean prebuilt_upload $FLAGS_FALSE "Upload prebuilt binary packages."
DEFINE_string to "$DEFAULT_TO" "Directory of build archive"
@@ -248,10 +250,9 @@ cp -f "${FLAGS_from}/au-generator.zip" "${OUTDIR}/"
function gsutil_archive() {
IN_PATH="$1"
OUT_PATH="$2"
- if [ -n "$FLAGS_gsutil_archive" ]
- then
+ echo "Using gsutil to archive to ${OUT_PATH}..."
+ if [ -n "$FLAGS_gsutil_archive" -a ${FLAGS_debug} -eq ${FLAGS_FALSE} ]; then
FULL_OUT_PATH="${FLAGS_gsutil_archive}/${OUT_PATH}"
- echo "Using gsutil to archive to ${OUT_PATH}..."
${FLAGS_gsutil} cp ${IN_PATH} ${FULL_OUT_PATH}
${FLAGS_gsutil} setacl ${FLAGS_acl} ${FULL_OUT_PATH}
if [ -n "$FLAGS_gsd_gen_index" ]
@@ -262,6 +263,9 @@ function gsutil_archive() {
-a ${FLAGS_acl} \
-p ${FULL_OUT_PATH} ${FLAGS_gsutil_archive}
fi
+ else
+ echo -n "In debug mode. Would have run: "
+ echo "gsutil cp ${IN_PATH} <gsutil_archive>/${OUT_PATH}"
fi
}
@@ -288,8 +292,12 @@ if [ $FLAGS_prebuilt_upload -eq $FLAGS_TRUE ]; then
prebuilt_cmd="$prebuilt_cmd --sync-host"
fi
- echo "Running $prebuilt_cmd"
- $prebuilt_cmd
+ if [ ${FLAGS_debug} -eq ${FLAGS_FALSE} ]; then
+ echo "Running $prebuilt_cmd"
+ $prebuilt_cmd
+ else
+ echo "Would have run $prebuilt_cmd"
+ fi
fi
gsutil_archive "${ZIPFILE}" "${LAST_CHANGE}/${FLAGS_zipname}"
@@ -312,6 +320,7 @@ if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \
gsutil_archive "${FACTORY_ZIPFILE}" \
"${LAST_CHANGE}/factory_${FLAGS_zipname}"
fi
+
gsutil_archive "${FLAGS_to}/LATEST" "LATEST"
if [ -n "${FLAGS_gsutil_archive}" ]; then
@@ -321,6 +330,10 @@ if [ -n "${FLAGS_gsutil_archive}" ]; then
https://sandbox.google.com/storage/${RELATIVE_ARCHIVE_URL_PATH}"
fi
+if [ -n "${FLAGS_test_tarball}" ]; then
+ gsutil_archive "${FLAGS_test_tarball}" "${LAST_CHANGE}/test_results.tgz"
+fi
+
# Purge old builds if necessary
if [ $FLAGS_keep_max -gt 0 ]; then
echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..."
« 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