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 GSUTIL_CP="${FLAGS_gsutil} cp -a ${FLAGS_acl}" | |
189 GSUTIL_GENERATE_INDEX="${FLAGS_gsd_gen_index} -a ${FLAGS_acl}" | 188 GSUTIL_GENERATE_INDEX="${FLAGS_gsd_gen_index} -a ${FLAGS_acl}" |
190 | 189 |
191 function gsutil_archive() { | 190 function gsutil_archive() { |
192 IN_PATH="$1" | 191 IN_PATH="$1" |
193 OUT_PATH="$2" | 192 OUT_PATH="$2" |
194 if [ $FLAGS_gsutil_archive != "" ] | 193 if [ $FLAGS_gsutil_archive != "" ] |
195 then | 194 then |
196 FULL_OUT_PATH="${FLAGS_gsutil_archive}/${OUT_PATH}" | 195 FULL_OUT_PATH="${FLAGS_gsutil_archive}/${OUT_PATH}" |
197 echo "Using gsutil to archive to ${OUT_PATH}..." | 196 echo "Using gsutil to archive to ${OUT_PATH}..." |
198 ${GSUTIL_CP} ${IN_PATH} ${FULL_OUT_PATH} | 197 ${FLAGS_gsutil} cp ${IN_PATH} ${FULL_OUT_PATH} |
| 198 ${FLAGS_gsutil} setacl ${FLAGS_acl} ${FULL_OUT_PATH} |
199 if [ $FLAGS_gsd_gen_index != "" ] | 199 if [ $FLAGS_gsd_gen_index != "" ] |
200 then | 200 then |
201 echo "Updating indexes..." | 201 echo "Updating indexes..." |
202 ${GSD_GENERATE_INDEX} -p ${FULL_OUT_PATH} ${FLAGS_gsutil_archive} | 202 ${GSD_GENERATE_INDEX} -p ${FULL_OUT_PATH} ${FLAGS_gsutil_archive} |
203 fi | 203 fi |
204 fi | 204 fi |
205 } | 205 } |
206 | 206 |
207 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] | 207 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] |
208 then | 208 then |
(...skipping 18 matching lines...) Expand all Loading... |
227 if [ $FLAGS_keep_max -gt 0 ] | 227 if [ $FLAGS_keep_max -gt 0 ] |
228 then | 228 then |
229 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 229 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
230 cd "$FLAGS_to" | 230 cd "$FLAGS_to" |
231 # +2 because line numbers start at 1 and need to skip LATEST file | 231 # +2 because line numbers start at 1 and need to skip LATEST file |
232 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 232 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
233 cd - | 233 cd - |
234 fi | 234 fi |
235 | 235 |
236 echo "Done." | 236 echo "Done." |
OLD | NEW |