OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to archive build results. Used by the buildbots. | 7 # Script to archive build results. Used by the buildbots. |
8 | 8 |
9 # --- BEGIN COMMON.SH BOILERPLATE --- | 9 # --- BEGIN COMMON.SH BOILERPLATE --- |
10 # Load common CrOS utilities. Inside the chroot this file is installed in | 10 # Load common CrOS utilities. Inside the chroot this file is installed in |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 gsutil_archive "${OUTDIR}/debug.tgz" "${LAST_CHANGE}/debug.tgz" | 307 gsutil_archive "${OUTDIR}/debug.tgz" "${LAST_CHANGE}/debug.tgz" |
308 fi | 308 fi |
309 | 309 |
310 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \ | 310 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \ |
311 [ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ]; then | 311 [ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ]; then |
312 gsutil_archive "${FACTORY_ZIPFILE}" \ | 312 gsutil_archive "${FACTORY_ZIPFILE}" \ |
313 "${LAST_CHANGE}/factory_${FLAGS_zipname}" | 313 "${LAST_CHANGE}/factory_${FLAGS_zipname}" |
314 fi | 314 fi |
315 gsutil_archive "${FLAGS_to}/LATEST" "LATEST" | 315 gsutil_archive "${FLAGS_to}/LATEST" "LATEST" |
316 | 316 |
| 317 if [ -n "${FLAGS_gsutil_archive}" ]; then |
| 318 FULL_INDEX_PATH="${FLAGS_gsutil_archive}/${LAST_CHANGE}/_index.html" |
| 319 RELATIVE_ARCHIVE_URL_PATH="${FULL_INDEX_PATH#gs://}" |
| 320 echo "CROS_ARCHIVE_URL=\ |
| 321 https://sandbox.google.com/storage/${RELATIVE_ARCHIVE_URL_PATH}" |
| 322 fi |
| 323 |
317 # Purge old builds if necessary | 324 # Purge old builds if necessary |
318 if [ $FLAGS_keep_max -gt 0 ]; then | 325 if [ $FLAGS_keep_max -gt 0 ]; then |
319 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 326 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
320 cd "$FLAGS_to" | 327 cd "$FLAGS_to" |
321 # +2 because line numbers start at 1 and need to skip LATEST file | 328 # +2 because line numbers start at 1 and need to skip LATEST file |
322 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 329 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
323 cd - | 330 cd - |
324 fi | 331 fi |
325 | 332 |
326 echo "Done." | 333 echo "Done." |
OLD | NEW |