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

Side by Side Diff: archive_build.sh

Issue 6527001: Remove old logic ... and don't needlessly modifiy dev image. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Use image name Created 9 years, 10 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 | Annotate | Revision Log
« 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 # --- 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 OUTDIR="${FLAGS_to}/${LAST_CHANGE}" 132 OUTDIR="${FLAGS_to}/${LAST_CHANGE}"
133 ZIPFILE="${OUTDIR}/${FLAGS_zipname}" 133 ZIPFILE="${OUTDIR}/${FLAGS_zipname}"
134 FACTORY_ZIPFILE="${OUTDIR}/factory_${FLAGS_zipname}" 134 FACTORY_ZIPFILE="${OUTDIR}/factory_${FLAGS_zipname}"
135 echo "archive to dir: $OUTDIR" 135 echo "archive to dir: $OUTDIR"
136 echo "archive to file: $ZIPFILE" 136 echo "archive to file: $ZIPFILE"
137 137
138 rm -rf "$OUTDIR" 138 rm -rf "$OUTDIR"
139 mkdir -p "$OUTDIR" 139 mkdir -p "$OUTDIR"
140 140
141 141
142 SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin" 142 SRC_IMAGE="${FLAGS_from}/${CHROMEOS_IMAGE_NAME}"
143 BACKUP_IMAGE="${FLAGS_from}/chromiumos_image_bkup.bin" 143 BACKUP_IMAGE="${FLAGS_from}/chromiumos_image_bkup.bin"
144 144
145 # Apply mod_image_for_test to the developer image, and store the 145 # Apply mod_image_for_test to the developer image, and store the
146 # result in a new location. Usage: 146 # result in a new location. Usage:
147 # do_chroot_mod "$OUTPUT_IMAGE" "--flags_to_mod_image_for_test" 147 # do_chroot_mod "$OUTPUT_IMAGE" "--flags_to_mod_image_for_test"
148 function do_chroot_mod() { 148 function do_chroot_mod() {
149 MOD_ARGS=$2 149 MOD_ARGS=$2
150 OUTPUT_IMAGE=$1 150 OUTPUT_IMAGE=$1
151 cp -f "${SRC_IMAGE}" "${BACKUP_IMAGE}" 151 cp -f "${SRC_IMAGE}" "${BACKUP_IMAGE}"
152 ./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board \ 152 ./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board \
153 --yes ${MOD_ARGS} 153 --yes --noinplace ${MOD_ARGS}
154 mv "${SRC_IMAGE}" "${OUTPUT_IMAGE}" 154 mv "${SRC_IMAGE}" "${OUTPUT_IMAGE}"
sjg 2011/02/15 22:25:34 This overwrites the test image!
155 mv "${BACKUP_IMAGE}" "${SRC_IMAGE}" 155 mv "${BACKUP_IMAGE}" "${SRC_IMAGE}"
156 } 156 }
157 157
158 # Modify image for test if flag set. 158 # Modify image for test if flag set.
159 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ]; then 159 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ]; then
160 echo "Modifying image for test" 160 echo "Modifying image for test"
161 do_chroot_mod "${FLAGS_from}/chromiumos_test_image.bin" "" 161 do_chroot_mod "${FLAGS_from}/chromiumos_test_image.bin" ""
162 162
sjg 2011/02/15 22:25:34 Well in that case I don't really understand this.
163 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" 163 pushd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local"
164 echo "Archiving autotest build artifacts" 164 echo "Archiving autotest build artifacts"
165 tar cjf "${FLAGS_from}/autotest.tar.bz2" --checkpoint=1000 autotest 165 tar cjf "${FLAGS_from}/autotest.tar.bz2" --checkpoint=1000 autotest
166 popd 166 popd
167 fi 167 fi
168 168
169 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ]; then 169 if [ $FLAGS_factory_test_mod -eq $FLAGS_TRUE ]; then
170 echo "Modifying image for factory test" 170 echo "Modifying image for factory test"
171 do_chroot_mod "${FLAGS_from}/chromiumos_factory_image.bin" \ 171 do_chroot_mod "${FLAGS_from}/chromiumos_factory_image.bin" \
172 "--factory" 172 "--factory"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 # Purge old builds if necessary 337 # Purge old builds if necessary
338 if [ $FLAGS_keep_max -gt 0 ]; then 338 if [ $FLAGS_keep_max -gt 0 ]; then
339 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." 339 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..."
340 cd "$FLAGS_to" 340 cd "$FLAGS_to"
341 # +2 because line numbers start at 1 and need to skip LATEST file 341 # +2 because line numbers start at 1 and need to skip LATEST file
342 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` 342 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))`
343 cd - 343 cd -
344 fi 344 fi
345 345
346 echo "Done." 346 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