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

Side by Side Diff: gce/uploader_iteration.sh

Issue 954693002: Store each file as "hash/<sha1>", list of hashes as "meta/@<rev>" and serve them at "serve_file/@<r… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chrome-devtools-frontend
Patch Set: rebase Created 5 years, 9 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 | « gae/main.py ('k') | 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 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This enables bash to treat any unhandled non-zero exit codes as "exceptions" 6 # This enables bash to treat any unhandled non-zero exit codes as "exceptions"
7 set -e 7 set -e
8 source $(dirname $0)/uploader_exit_codes.sh 8 source $(dirname $0)/uploader_exit_codes.sh
9 9
10 mark_step() { 10 mark_step() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 fi 55 fi
56 56
57 mark_step 'Building DevTools frontend for revisions and uploading to Cloud Stora ge' 57 mark_step 'Building DevTools frontend for revisions and uploading to Cloud Stora ge'
58 for REVISION in $REVISION_LIST; do 58 for REVISION in $REVISION_LIST; do
59 LOCAL_STORAGE_DIR=/uploader/storage 59 LOCAL_STORAGE_DIR=/uploader/storage
60 if [ -d $LOCAL_STORAGE_DIR ]; then 60 if [ -d $LOCAL_STORAGE_DIR ]; then
61 rm -rf $LOCAL_STORAGE_DIR 61 rm -rf $LOCAL_STORAGE_DIR
62 fi 62 fi
63 ZIPS_DIR="$LOCAL_STORAGE_DIR/zips" 63 ZIPS_DIR="$LOCAL_STORAGE_DIR/zips"
64 REVS_DIR="$LOCAL_STORAGE_DIR/revs" 64 REVS_DIR="$LOCAL_STORAGE_DIR/revs"
65 mkdir -p $ZIPS_DIR $REVS_DIR 65 META_DIR="$LOCAL_STORAGE_DIR/meta"
66 HASH_DIR="$LOCAL_STORAGE_DIR/hash"
67 mkdir -p $ZIPS_DIR $REVS_DIR $META_DIR $HASH_DIR
66 68
67 if echo "$BLINK_REVISIONS_BLACKLIST" | grep -w $REVISION; then 69 if echo "$BLINK_REVISIONS_BLACKLIST" | grep -w $REVISION; then
68 echo "Revision $REVISION is in the blacklist, skipping over" 70 echo "Revision $REVISION is in the blacklist, skipping over"
69 continue 71 continue
70 fi 72 fi
71 73
72 pushd blink 74 pushd blink
73 REVISION_COMMIT=$(git log -n 1 --all --grep="git-svn-id:[^@]*@$REVISION" --p retty=oneline | awk '{ print $1; }') 75 REVISION_COMMIT=$(git log -n 1 --all --grep="git-svn-id:[^@]*@$REVISION" --p retty=oneline | awk '{ print $1; }')
74 if [ -z "$REVISION_COMMIT" ]; then 76 if [ -z "$REVISION_COMMIT" ]; then
75 echo "@$REVISION ==> missing!" 77 echo "@$REVISION ==> missing!"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 CACHE MANIFEST 124 CACHE MANIFEST
123 FALLBACK: 125 FALLBACK:
124 EOF 126 EOF
125 for FALLBACK_ENTRY in $FALLBACK_ENTRIES; do 127 for FALLBACK_ENTRY in $FALLBACK_ENTRIES; do
126 echo "$FALLBACK_ENTRY $FALLBACK_ENTRY" >> $MANIFEST_FILE_NAME 128 echo "$FALLBACK_ENTRY $FALLBACK_ENTRY" >> $MANIFEST_FILE_NAME
127 done 129 done
128 echo "CACHE:" >> $MANIFEST_FILE_NAME 130 echo "CACHE:" >> $MANIFEST_FILE_NAME
129 find -type f -not -name $MANIFEST_FILE_NAME -print | sed -e 's#^\./##' >> $M ANIFEST_FILE_NAME 131 find -type f -not -name $MANIFEST_FILE_NAME -print | sed -e 's#^\./##' >> $M ANIFEST_FILE_NAME
130 132
131 zip -9r $ZIP_FILE * || exit $EXIT_ZIP_FRONTEND 133 zip -9r $ZIP_FILE * || exit $EXIT_ZIP_FRONTEND
134
135 # Copy each file to hash/<sha1>, write <sha1>:<path> to meta file.
136 META_FILE_NAME="$META_DIR/@$REVISION"
137 for FILE_NAME in $(find -type f); do
138 FILE_SHA1=$(sha1sum $FILE_NAME | awk '{print $1}')
139 cp $FILE_NAME "$HASH_DIR/$FILE_SHA1"
140 echo "$FILE_SHA1:${FILE_NAME##./}" >> $META_FILE_NAME
141 done;
142
132 popd 143 popd
133 144
134 ZIP_SHA1=$(sha1sum $ZIP_FILE | awk '{print $1}') 145 ZIP_SHA1=$(sha1sum $ZIP_FILE | awk '{print $1}')
135 mv $ZIP_FILE "$ZIPS_DIR/$ZIP_SHA1.zip" 146 mv $ZIP_FILE "$ZIPS_DIR/$ZIP_SHA1.zip"
136 echo "$ZIP_SHA1" > "$REVS_DIR/@$REVISION" 147 echo "$ZIP_SHA1" > "$REVS_DIR/@$REVISION"
137 148
138 # Comment out the line below for testing. 149 # Comment out the line below for testing.
139 gsutil -m cp -R $LOCAL_STORAGE_DIR/* $GS_PATH || exit $EXIT_CS_UPLOAD 150 gsutil -m cp -R $LOCAL_STORAGE_DIR/* $GS_PATH || exit $EXIT_CS_UPLOAD
140 done 151 done
OLDNEW
« no previous file with comments | « gae/main.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698