| 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 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
| 10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 echo "archive to dir: $OUTDIR" | 86 echo "archive to dir: $OUTDIR" |
| 87 echo "archive to file: $ZIPFILE" | 87 echo "archive to file: $ZIPFILE" |
| 88 | 88 |
| 89 rm -rf "$OUTDIR" | 89 rm -rf "$OUTDIR" |
| 90 mkdir -p "$OUTDIR" | 90 mkdir -p "$OUTDIR" |
| 91 | 91 |
| 92 # Modify image for test if flag set. | 92 # Modify image for test if flag set. |
| 93 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] | 93 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] |
| 94 then | 94 then |
| 95 echo "Modifying image for test" | 95 echo "Modifying image for test" |
| 96 cp "${FLAGS_from}/rootfs.image" "${FLAGS_from}/rootfs_test.image" | 96 SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin" |
| 97 cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_test_image.bin" |
| 98 SRC_IMAGE="${FLAGS_from}/chromiumos_test_image.bin" |
| 97 "${SCRIPTS_DIR}/mod_image_for_test.sh" --board $FLAGS_board --yes --image \ | 99 "${SCRIPTS_DIR}/mod_image_for_test.sh" --board $FLAGS_board --yes --image \ |
| 98 "${FLAGS_from}/rootfs_test.image" | 100 "${SRC_IMAGE}" |
| 99 cd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" | 101 cd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" |
| 100 echo "Archiving autotest build artifacts" | 102 echo "Archiving autotest build artifacts" |
| 101 tar cjf "${FLAGS_from}/autotest.tar.bz2" autotest | 103 tar cjf "${FLAGS_from}/autotest.tar.bz2" autotest |
| 102 fi | 104 fi |
| 103 | 105 |
| 104 # Zip the build | 106 # Zip the build |
| 105 echo "Compressing and archiving build..." | 107 echo "Compressing and archiving build..." |
| 106 cd "$FLAGS_from" | 108 cd "$FLAGS_from" |
| 107 zip -r "$ZIPFILE" * | 109 zip -r "$ZIPFILE" * |
| 108 cd - | 110 cd - |
| (...skipping 17 matching lines...) Expand all Loading... |
| 126 if [ $FLAGS_keep_max -gt 0 ] | 128 if [ $FLAGS_keep_max -gt 0 ] |
| 127 then | 129 then |
| 128 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 130 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
| 129 cd "$FLAGS_to" | 131 cd "$FLAGS_to" |
| 130 # +2 because line numbers start at 1 and need to skip LATEST file | 132 # +2 because line numbers start at 1 and need to skip LATEST file |
| 131 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 133 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
| 132 cd - | 134 cd - |
| 133 fi | 135 fi |
| 134 | 136 |
| 135 echo "Done." | 137 echo "Done." |
| OLD | NEW |