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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 echo "archive to dir: $OUTDIR" | 98 echo "archive to dir: $OUTDIR" |
99 echo "archive to file: $ZIPFILE" | 99 echo "archive to file: $ZIPFILE" |
100 | 100 |
101 rm -rf "$OUTDIR" | 101 rm -rf "$OUTDIR" |
102 mkdir -p "$OUTDIR" | 102 mkdir -p "$OUTDIR" |
103 | 103 |
104 # Modify image for test if flag set. | 104 # Modify image for test if flag set. |
105 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] | 105 if [ $FLAGS_test_mod -eq $FLAGS_TRUE ] |
106 then | 106 then |
107 echo "Modifying image for test" | 107 echo "Modifying image for test" |
108 SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin" | 108 SRC_IMAGE="${FLAGS_from}/chromiumos_image.bin" |
Nick Sanders
2010/05/20 00:56:55
It looks like this is destructive to the image dir
| |
109 cp -f "${SRC_IMAGE}" "${FLAGS_from}/chromiumos_image_bkup.bin" | |
110 ./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board --yes | 109 ./enter_chroot.sh -- ./mod_image_for_test.sh --board $FLAGS_board --yes |
111 mv "$SRC_IMAGE" "${FLAGS_from}/chromiumos_test_image.bin" | 110 mv "$SRC_IMAGE" "${FLAGS_from}/chromiumos_test_image.bin" |
112 mv "${FLAGS_from}/chromiumos_image_bkup.bin" "$SRC_IMAGE" | |
113 cd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" | 111 cd "${FLAGS_chroot}/build/${FLAGS_board}/usr/local" |
114 echo "Archiving autotest build artifacts" | 112 echo "Archiving autotest build artifacts" |
115 tar cjf "${FLAGS_from}/autotest.tar.bz2" autotest | 113 tar cjf "${FLAGS_from}/autotest.tar.bz2" autotest |
116 fi | 114 fi |
117 | 115 |
118 # Zip the build | 116 # Zip the build |
119 echo "Compressing and archiving build..." | 117 echo "Compressing and archiving build..." |
120 cd "$FLAGS_from" | 118 cd "$FLAGS_from" |
121 zip -r "$ZIPFILE" * | 119 zip -r "$ZIPFILE" * |
122 cd - | 120 cd - |
(...skipping 17 matching lines...) Expand all Loading... | |
140 if [ $FLAGS_keep_max -gt 0 ] | 138 if [ $FLAGS_keep_max -gt 0 ] |
141 then | 139 then |
142 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 140 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
143 cd "$FLAGS_to" | 141 cd "$FLAGS_to" |
144 # +2 because line numbers start at 1 and need to skip LATEST file | 142 # +2 because line numbers start at 1 and need to skip LATEST file |
145 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 143 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
146 cd - | 144 cd - |
147 fi | 145 fi |
148 | 146 |
149 echo "Done." | 147 echo "Done." |
OLD | NEW |