| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] | 210 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] |
| 211 then | 211 then |
| 212 echo "Creating hwqual archive" | 212 echo "Creating hwqual archive" |
| 213 HWQUAL_NAME="chromeos-hwqual-${FLAGS_board}-${CHROMEOS_VERSION_STRING}" | 213 HWQUAL_NAME="chromeos-hwqual-${FLAGS_board}-${CHROMEOS_VERSION_STRING}" |
| 214 "${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \ | 214 "${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \ |
| 215 --output_tag "${HWQUAL_NAME}" | 215 --output_tag "${HWQUAL_NAME}" |
| 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}" |
| 221 |
| 220 if [ $FLAGS_archive_debug -eq $FLAGS_TRUE ] | 222 if [ $FLAGS_archive_debug -eq $FLAGS_TRUE ] |
| 221 then | 223 then |
| 222 echo "Creating debug archive" | 224 echo "Creating debug archive" |
| 223 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/lib" | 225 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/lib" |
| 224 sudo tar czf "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \ | 226 sudo tar czf "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \ |
| 225 --exclude debug/tests debug | 227 --exclude debug/tests debug |
| 226 CMD="chown \${SUDO_UID}:\${SUDO_GID} ${OUTDIR}/debug.tgz" | 228 CMD="chown \${SUDO_UID}:\${SUDO_GID} ${OUTDIR}/debug.tgz" |
| 227 sudo sh -c "${CMD}" | 229 sudo sh -c "${CMD}" |
| 228 popd | 230 popd |
| 231 gsutil_archive "${OUTDIR}/debug.tgz" "${LAST_CHANGE}/debug.tgz" |
| 229 fi | 232 fi |
| 230 | 233 |
| 231 gsutil_archive "${ZIPFILE}" "${LAST_CHANGE}/${FLAGS_zipname}" | |
| 232 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \ | 234 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ] || \ |
| 233 [ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ] | 235 [ $FLAGS_factory_install_mod -eq $FLAGS_TRUE ] |
| 234 then | 236 then |
| 235 gsutil_archive "${FACTORY_ZIPFILE}" \ | 237 gsutil_archive "${FACTORY_ZIPFILE}" \ |
| 236 "${LAST_CHANGE}/factory_${FLAGS_zipname}" | 238 "${LAST_CHANGE}/factory_${FLAGS_zipname}" |
| 237 fi | 239 fi |
| 238 gsutil_archive "${FLAGS_to}/LATEST" "LATEST" | 240 gsutil_archive "${FLAGS_to}/LATEST" "LATEST" |
| 239 | 241 |
| 240 # Purge old builds if necessary | 242 # Purge old builds if necessary |
| 241 if [ $FLAGS_keep_max -gt 0 ] | 243 if [ $FLAGS_keep_max -gt 0 ] |
| 242 then | 244 then |
| 243 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 245 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
| 244 cd "$FLAGS_to" | 246 cd "$FLAGS_to" |
| 245 # +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 |
| 246 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 248 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
| 247 cd - | 249 cd - |
| 248 fi | 250 fi |
| 249 | 251 |
| 250 echo "Done." | 252 echo "Done." |
| OLD | NEW |