Chromium Code Reviews| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 } | 134 } |
| 135 | 135 |
| 136 # Modify image for test if flag set. | 136 # Modify image for test if flag set. |
| 137 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] | 137 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] |
| 138 then | 138 then |
| 139 echo "Modifying image for test" | 139 echo "Modifying image for test" |
| 140 do_chroot_mod "${FLAGS_from}/chromiumos_test_image.bin" "" | 140 do_chroot_mod "${FLAGS_from}/chromiumos_test_image.bin" "" |
| 141 | 141 |
| 142 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" | 142 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" |
| 143 echo "Archiving autotest build artifacts" | 143 echo "Archiving autotest build artifacts" |
| 144 tar cjf "${FLAGS_from}/autotest.tar.bz2" autotest | 144 tar cjfv "${FLAGS_from}/autotest.tar.bz2" autotest |
|
Christopher Covington
2010/07/28 17:30:51
Would --checkpoint be more suitable? I'm worried -
zel
2010/07/28 18:27:05
There are some pretty large files there. I am afra
| |
| 145 popd | 145 popd |
| 146 fi | 146 fi |
| 147 | 147 |
| 148 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] | 148 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] |
| 149 then | 149 then |
| 150 echo "Modifying image for factory test" | 150 echo "Modifying image for factory test" |
| 151 do_chroot_mod "${FLAGS_from}/chromiumos_factory_image.bin" \ | 151 do_chroot_mod "${FLAGS_from}/chromiumos_factory_image.bin" \ |
| 152 "--factory" | 152 "--factory" |
| 153 fi | 153 fi |
| 154 | 154 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 gsutil_archive "${OUTDIR}/${HWQUAL_NAME}.tar.bz2" \ | 216 gsutil_archive "${OUTDIR}/${HWQUAL_NAME}.tar.bz2" \ |
| 217 "${LAST_CHANGE}/${HWQUAL_NAME}.tar.bz2" | 217 "${LAST_CHANGE}/${HWQUAL_NAME}.tar.bz2" |
| 218 fi | 218 fi |
| 219 | 219 |
| 220 gsutil_archive "${ZIPFILE}" "${LAST_CHANGE}/${FLAGS_zipname}" | 220 gsutil_archive "${ZIPFILE}" "${LAST_CHANGE}/${FLAGS_zipname}" |
| 221 | 221 |
| 222 if [ $FLAGS_archive_debug -eq $FLAGS_TRUE ] | 222 if [ $FLAGS_archive_debug -eq $FLAGS_TRUE ] |
| 223 then | 223 then |
| 224 echo "Creating debug archive" | 224 echo "Creating debug archive" |
| 225 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/lib" | 225 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/lib" |
| 226 sudo tar czf "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \ | 226 sudo tar czfv "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \ |
| 227 --exclude debug/tests debug | 227 --exclude debug/tests debug |
| 228 CMD="chown \${SUDO_UID}:\${SUDO_GID} ${OUTDIR}/debug.tgz" | 228 CMD="chown \${SUDO_UID}:\${SUDO_GID} ${OUTDIR}/debug.tgz" |
| 229 sudo sh -c "${CMD}" | 229 sudo sh -c "${CMD}" |
| 230 popd | 230 popd |
| 231 gsutil_archive "${OUTDIR}/debug.tgz" "${LAST_CHANGE}/debug.tgz" | 231 gsutil_archive "${OUTDIR}/debug.tgz" "${LAST_CHANGE}/debug.tgz" |
| 232 fi | 232 fi |
| 233 | 233 |
| 234 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \ | 234 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \ |
| 235 [ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ] | 235 [ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ] |
| 236 then | 236 then |
| 237 gsutil_archive "${FACTORY_ZIPFILE}" \ | 237 gsutil_archive "${FACTORY_ZIPFILE}" \ |
| 238 "${LAST_CHANGE}/factory_${FLAGS_zipname}" | 238 "${LAST_CHANGE}/factory_${FLAGS_zipname}" |
| 239 fi | 239 fi |
| 240 gsutil_archive "${FLAGS_to}/LATEST" "LATEST" | 240 gsutil_archive "${FLAGS_to}/LATEST" "LATEST" |
| 241 | 241 |
| 242 # Purge old builds if necessary | 242 # Purge old builds if necessary |
| 243 if [ $FLAGS_keep_max -gt 0 ] | 243 if [ $FLAGS_keep_max -gt 0 ] |
| 244 then | 244 then |
| 245 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 245 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
| 246 cd "$FLAGS_to" | 246 cd "$FLAGS_to" |
| 247 # +2 because line numbers start at 1 and need to skip LATEST file | 247 # +2 because line numbers start at 1 and need to skip LATEST file |
| 248 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 248 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
| 249 cd - | 249 cd - |
| 250 fi | 250 fi |
| 251 | 251 |
| 252 echo "Done." | 252 echo "Done." |
| OLD | NEW |