Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: archive_build.sh

Issue 2806088: Add checkpoints to archive_build (Closed) Base URL: ssh://git@chromiumos-git//crosutils.git
Patch Set: fix ws Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 cjfv "${FLAGS_from}/autotest.tar.bz2" autotest 144 tar cjf "${FLAGS_from}/autotest.tar.bz2" --checkpoint=1000 autotest
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
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 czfv "${OUTDIR}/debug.tgz" --exclude debug/usr/local/autotest \ 226 sudo tar czf "${OUTDIR}/debug.tgz" --checkpoint=1000 --exclude\
227 --exclude debug/tests debug 227 debug/usr/local/autotest --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."
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698