Chromium Code Reviews| Index: archive_build.sh |
| diff --git a/archive_build.sh b/archive_build.sh |
| index e4ea0f2ab09aa121b4c3d4d14b44a2446984528c..82f723a005d5dd7814ecca6f946901f863a08e94 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 |
|
dgarrett
2011/02/12 01:46:05
I'm being picky just to prove a really read this..
scottz
2011/02/12 01:49:01
On that note since we are only either doing what i
|
| 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,8 +320,13 @@ 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_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})..." |