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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 cd - | 178 cd - |
179 | 179 |
180 # Update LATEST file | 180 # Update LATEST file |
181 echo "$LAST_CHANGE" > "${FLAGS_to}/LATEST" | 181 echo "$LAST_CHANGE" > "${FLAGS_to}/LATEST" |
182 | 182 |
183 # Make sure files are readable | 183 # Make sure files are readable |
184 chmod 644 "$ZIPFILE" "${FLAGS_to}/LATEST" | 184 chmod 644 "$ZIPFILE" "${FLAGS_to}/LATEST" |
185 chmod 755 "$OUTDIR" | 185 chmod 755 "$OUTDIR" |
186 | 186 |
187 | 187 |
188 GSD_GENERATE_INDEX="${FLAGS_gsd_gen_index} -a ${FLAGS_acl}" | |
189 | |
190 function gsutil_archive() { | 188 function gsutil_archive() { |
191 IN_PATH="$1" | 189 IN_PATH="$1" |
192 OUT_PATH="$2" | 190 OUT_PATH="$2" |
193 if [ $FLAGS_gsutil_archive != "" ] | 191 if [ $FLAGS_gsutil_archive != "" ] |
194 then | 192 then |
195 FULL_OUT_PATH="${FLAGS_gsutil_archive}/${OUT_PATH}" | 193 FULL_OUT_PATH="${FLAGS_gsutil_archive}/${OUT_PATH}" |
196 echo "Using gsutil to archive to ${OUT_PATH}..." | 194 echo "Using gsutil to archive to ${OUT_PATH}..." |
197 ${FLAGS_gsutil} cp ${IN_PATH} ${FULL_OUT_PATH} | 195 ${FLAGS_gsutil} cp ${IN_PATH} ${FULL_OUT_PATH} |
198 ${FLAGS_gsutil} setacl ${FLAGS_acl} ${FULL_OUT_PATH} | 196 ${FLAGS_gsutil} setacl ${FLAGS_acl} ${FULL_OUT_PATH} |
199 if [ $FLAGS_gsd_gen_index != "" ] | 197 if [ $FLAGS_gsd_gen_index != "" ] |
200 then | 198 then |
201 echo "Updating indexes..." | 199 echo "Updating indexes..." |
202 ${GSD_GENERATE_INDEX} -p ${FULL_OUT_PATH} ${FLAGS_gsutil_archive} | 200 ${FLAGS_gsd_gen_index} \ |
| 201 --gsutil=${FLAGS_gsutil} \ |
| 202 -a ${FLAGS_acl} \ |
| 203 -p ${FULL_OUT_PATH} ${FLAGS_gsutil_archive} |
203 fi | 204 fi |
204 fi | 205 fi |
205 } | 206 } |
206 | 207 |
207 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] | 208 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] |
208 then | 209 then |
209 echo "Creating hwqual archive" | 210 echo "Creating hwqual archive" |
210 HWQUAL_NAME="chromeos-hwqual-${FLAGS_board}-${CHROMEOS_VERSION_STRING}" | 211 HWQUAL_NAME="chromeos-hwqual-${FLAGS_board}-${CHROMEOS_VERSION_STRING}" |
211 "${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \ | 212 "${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \ |
212 --output_tag "${HWQUAL_NAME}" | 213 --output_tag "${HWQUAL_NAME}" |
(...skipping 14 matching lines...) Expand all Loading... |
227 if [ $FLAGS_keep_max -gt 0 ] | 228 if [ $FLAGS_keep_max -gt 0 ] |
228 then | 229 then |
229 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 230 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
230 cd "$FLAGS_to" | 231 cd "$FLAGS_to" |
231 # +2 because line numbers start at 1 and need to skip LATEST file | 232 # +2 because line numbers start at 1 and need to skip LATEST file |
232 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 233 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
233 cd - | 234 cd - |
234 fi | 235 fi |
235 | 236 |
236 echo "Done." | 237 echo "Done." |
OLD | NEW |