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

Side by Side Diff: gce/uploader_iteration.sh

Issue 1370443006: [chrome-devtools-frontend] Updates after Blink+Chromium merge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chrome-devtools-frontend
Patch Set: Created 5 years, 2 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 | « gce/uploader_bisect_helper.sh ('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 12 matching lines...) Expand all
23 } 23 }
24 24
25 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 25 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
26 26
27 mark_step 'Moving to the source code directory' 27 mark_step 'Moving to the source code directory'
28 SOURCE_DIR=/uploader/src/chrome 28 SOURCE_DIR=/uploader/src/chrome
29 cd "$SOURCE_DIR" 29 cd "$SOURCE_DIR"
30 30
31 mark_step 'Updating chromium' 31 mark_step 'Updating chromium'
32 unlock_git_repo Chromium || exit $EXIT_CHROMIUM_UPDATE 32 unlock_git_repo Chromium || exit $EXIT_CHROMIUM_UPDATE
33 git reset --hard master || exit $EXIT_CHROMIUM_UPDATE 33 git bisect reset || exit $EXIT_CHROMIUM_UPDATE
34 git pull || exit $EXIT_CHROMIUM_UPDATE 34 git reset --hard || exit $EXIT_CHROMIUM_UPDATE
35 git clean -df || exit $EXIT_CHROMIUM_UPDATE
36 git checkout master || exit $EXIT_CHROMIUM_UPDATE
37 git pull origin || exit $EXIT_CHROMIUM_UPDATE
35 CHROMIUM_GYP_REVISION="$(cat DEPS | $SCRIPT_DIR/uploader_helper.py --find_projec t_revision='src/tools/gyp')" 38 CHROMIUM_GYP_REVISION="$(cat DEPS | $SCRIPT_DIR/uploader_helper.py --find_projec t_revision='src/tools/gyp')"
36 39
37 mark_step 'Updating gyp' 40 mark_step 'Updating gyp'
38 pushd tools/gyp 41 pushd tools/gyp
39 unlock_git_repo Gyp 42 unlock_git_repo Gyp
40 git fetch || exit $EXIT_GYP_UPDATE 43 git fetch || exit $EXIT_GYP_UPDATE
41 git reset --hard $CHROMIUM_GYP_REVISION || exit $EXIT_GYP_UPDATE 44 git reset --hard $CHROMIUM_GYP_REVISION || exit $EXIT_GYP_UPDATE
42 popd 45 popd
43 46
44 mark_step 'Getting the last Blink revision for which the frontend has been uploa ded' 47 # The commits where LASTCHANGE.blink got fixed. All branches after the Blink mer ge
48 # should use the same as for master branch, but branches for M45 and M46 have
49 # their own commits.
50 mark_step 'Figuring out the list of branches'
51 declare -A FIRST_GOOD_COMMITS_AFTER_MERGE=(
52 ["master"]=f880f0071d47ec1aa9608245222ad0b6f350e48c
53 ["branch-heads/2454"]=2d9701ab99b7de44897c731ff8f16dafb8fd7834
54 ["branch-heads/2490"]=9a2f5e019e324fab91c29681c18937c4435c309b
55 )
56 # Special branches.
57 BRANCHES_LIST="master branch-heads/2454 branch-heads/2490"
58 # Get a list of branches that were branched after the "first good commit"
59 # (post-merge) on master. This can take a lot of time, unfortunately,
60 # because the number of branches is excessive.
61 BRANCHES_LIST="$BRANCHES_LIST $(git branch -r --contains ${FIRST_GOOD_COMMITS_AF TER_MERGE[master]} --list 'branch-heads/*')"
62
63 mark_step 'Getting the list of commits to upload'
45 GS_PATH=gs://chrome-devtools-frontend 64 GS_PATH=gs://chrome-devtools-frontend
46 KNOWN_REVISIONS_DIR="$GS_PATH/revs" 65 KNOWN_REVISIONS_DIR="$GS_PATH/revs"
47 ALL_UPLOADED_REVS=$(gsutil ls "$KNOWN_REVISIONS_DIR") || exit $EXIT_LAST_UPLOADE D_BLINK_REV 66 REVISION_LIST=""
48 LAST_BLINK_REVISION=$(echo "$ALL_UPLOADED_REVS" | sed -e "s#^$KNOWN_REVISIONS_DI R/@##" | sort -nr | head -n 1) 67 for BRANCH in $BRANCHES_LIST; do
49 if [ -z "$LAST_BLINK_REVISION" ]; then 68 echo "Branch $BRANCH"
50 exit $EXIT_LAST_UPLOADED_BLINK_REV 69 # Use bisect to find the first not yet uploaded commit.
51 fi 70 # First, make sure that master hasn't been uploaded and thus is "bad",
52 echo "Last uploaded was for Blink revision $LAST_BLINK_REVISION" 71 # otherwise bisect will be confused.
72 if gsutil ls "$KNOWN_REVISIONS_DIR/@$(git rev-parse $BRANCH)"; then
73 echo "On $BRANCH no new commits since the last upload"
74 else
75 FIRST_GOOD=${FIRST_GOOD_COMMITS_AFTER_MERGE["$BRANCH"]}
76 if [ -z "$FIRST_GOOD" ]; then
77 FIRST_GOOD=${FIRST_GOOD_COMMITS_AFTER_MERGE["master"]}
78 fi
79 git bisect start --no-checkout $BRANCH $FIRST_GOOD || exit $EXIT_LAST_UP LOADED_BLINK_REV
80 git bisect run sh -c "$SCRIPT_DIR/uploader_bisect_helper.sh $KNOWN_REVIS IONS_DIR/@" || exit $EXIT_LAST_UPLOADED_BLINK_REV
81 # BISECT_HEAD now points to the last "good" commit.
82 # There is some kind of a side effect, we need to retrieve it first.
83 git rev-parse BISECT_HEAD
84 # Get the list of all "bad" commits, starting from the oldest commit.
85 REVISION_LIST="$REVISION_LIST $(git rev-list --reverse $BRANCH ^BISECT_H EAD)"
86 git bisect reset || exit $EXIT_LAST_UPLOADED_BLINK_REV
87 fi
88 done
53 89
54 mark_step 'Getting Blink revisions blacklist' 90 mark_step 'Getting Blink revisions blacklist'
55 BLINK_REVISIONS_BLACKLIST_FILE=$GS_PATH/blink_revisions_blacklist 91 BLINK_REVISIONS_BLACKLIST_FILE=$GS_PATH/blink_revisions_blacklist
56 BLINK_REVISIONS_BLACKLIST="" 92 BLINK_REVISIONS_BLACKLIST=""
57 if gsutil ls "$BLINK_REVISIONS_BLACKLIST_FILE"; then 93 if gsutil ls "$BLINK_REVISIONS_BLACKLIST_FILE"; then
58 BLINK_REVISIONS_BLACKLIST=$(gsutil cat "$BLINK_REVISIONS_BLACKLIST_FILE") 94 BLINK_REVISIONS_BLACKLIST=$(gsutil cat "$BLINK_REVISIONS_BLACKLIST_FILE")
59 fi 95 fi
60 96
61 mark_step 'Working out SVN revisions list'
62 pushd third_party/WebKit
63 git fetch || exit $EXIT_BLINK_UPDATE
64 HEAD_BLINK_REVISION=$(git log -n 1 --all --grep="git-svn-id:" --pretty=medium | grep -Po "git-svn-id:[^@]*@\d+" | grep -Po "@\d+" | grep -Po "\d+")
65 popd
66 echo "Last committed was Blink revision $HEAD_BLINK_REVISION"
67 REVISION_LIST=$(seq $[LAST_BLINK_REVISION+1] $HEAD_BLINK_REVISION)
68 if [ -z "$REVISION_LIST" ]; then
69 exit $EXIT_NO_UPDATED_BRANCHES
70 fi
71
72 mark_step 'Building DevTools frontend for revisions and uploading to Cloud Stora ge' 97 mark_step 'Building DevTools frontend for revisions and uploading to Cloud Stora ge'
73 for REVISION in $REVISION_LIST; do 98 for REVISION in $REVISION_LIST; do
74 LOCAL_STORAGE_DIR=/uploader/storage 99 LOCAL_STORAGE_DIR=/uploader/storage
75 if [ -d $LOCAL_STORAGE_DIR ]; then 100 if [ -d $LOCAL_STORAGE_DIR ]; then
76 rm -rf $LOCAL_STORAGE_DIR 101 rm -rf $LOCAL_STORAGE_DIR
77 fi 102 fi
78 ZIPS_DIR="$LOCAL_STORAGE_DIR/zips" 103 ZIPS_DIR="$LOCAL_STORAGE_DIR/zips"
79 REVS_DIR="$LOCAL_STORAGE_DIR/revs" 104 REVS_DIR="$LOCAL_STORAGE_DIR/revs"
80 META_DIR="$LOCAL_STORAGE_DIR/meta" 105 META_DIR="$LOCAL_STORAGE_DIR/meta"
81 HASH_DIR="$LOCAL_STORAGE_DIR/hash" 106 HASH_DIR="$LOCAL_STORAGE_DIR/hash"
82 mkdir -p $ZIPS_DIR $REVS_DIR $META_DIR $HASH_DIR 107 mkdir -p $ZIPS_DIR $REVS_DIR $META_DIR $HASH_DIR
83 108
84 if echo "$BLINK_REVISIONS_BLACKLIST" | grep -w $REVISION; then 109 if echo "$BLINK_REVISIONS_BLACKLIST" | grep -w $REVISION; then
85 echo "Revision $REVISION is in the blacklist, skipping over" 110 echo "Revision $REVISION is in the blacklist, skipping over"
86 continue 111 continue
87 fi 112 fi
88 113
89 pushd third_party/WebKit 114 echo "Processing $REVISION"
90 REVISION_COMMIT=$(git log -n 1 --all --grep="git-svn-id:[^@]*@$REVISION" --p retty=oneline | awk '{ print $1; }') 115 git reset --hard || exit $EXIT_BLINK_UPDATE
91 if [ -z "$REVISION_COMMIT" ]; then 116 git clean -df || exit $EXIT_BLINK_UPDATE
92 echo "@$REVISION ==> missing!" 117 git checkout $REVISION || exit $EXIT_BLINK_UPDATE
93 popd
94 continue
95 fi
96 echo "@$REVISION ==> $REVISION_COMMIT"
97 unlock_git_repo Blink || exit $EXIT_BLINK_UPDATE
98 git reset --hard $REVISION_COMMIT || exit $EXIT_BLINK_UPDATE
99 118
100 # Exclude "trunk" to work around branches that accidentally have a second 119 # Exclude "trunk" to work around branches that accidentally have a second
101 # copy of Blink sources inside it. See http://crbug.com/450975 120 # copy of Blink sources inside it. See http://crbug.com/450975
121 pushd third_party/WebKit
102 DEVTOOLS_GYP=$(find . -type f -name devtools.gyp -not -path "*/trunk/*") 122 DEVTOOLS_GYP=$(find . -type f -name devtools.gyp -not -path "*/trunk/*")
103 if [ -z "$DEVTOOLS_GYP" ]; then 123 if [ -z "$DEVTOOLS_GYP" ]; then
104 exit $EXIT_DEVTOOLS_GYP_FILE 124 exit $EXIT_DEVTOOLS_GYP_FILE
105 fi 125 fi
106 if [ -d ../../out ]; then 126 if [ -d ../../out ]; then
107 rm -rf ../../out 127 rm -rf ../../out
108 fi 128 fi
109 DEVTOOLS_DIR=$(dirname "$DEVTOOLS_GYP") 129 DEVTOOLS_DIR=$(dirname "$DEVTOOLS_GYP")
110 #TODO: need to calculate depth and output paths based on DEVTOOLS_DIR nestin g level 130 #TODO: need to calculate depth and output paths based on DEVTOOLS_DIR nestin g level
111 GYP_GENERATORS=ninja ../../tools/gyp/gyp --toplevel-dir="$DEVTOOLS_DIR" --de pth=../../../.. --generator-output=../../../.. "$DEVTOOLS_GYP" || exit $EXIT_GYP _DEVTOOLS 131 GYP_GENERATORS=ninja ../../tools/gyp/gyp --toplevel-dir="$DEVTOOLS_DIR" --de pth=../../../.. --generator-output=../../../.. "$DEVTOOLS_GYP" || exit $EXIT_GYP _DEVTOOLS
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 175
156 popd 176 popd
157 177
158 ZIP_SHA1=$(sha1sum $ZIP_FILE | awk '{print $1}') 178 ZIP_SHA1=$(sha1sum $ZIP_FILE | awk '{print $1}')
159 mv $ZIP_FILE "$ZIPS_DIR/$ZIP_SHA1.zip" 179 mv $ZIP_FILE "$ZIPS_DIR/$ZIP_SHA1.zip"
160 echo "$ZIP_SHA1" > "$REVS_DIR/@$REVISION" 180 echo "$ZIP_SHA1" > "$REVS_DIR/@$REVISION"
161 181
162 # Comment out the line below for testing. 182 # Comment out the line below for testing.
163 gsutil -m cp -R $LOCAL_STORAGE_DIR/* $GS_PATH || exit $EXIT_CS_UPLOAD 183 gsutil -m cp -R $LOCAL_STORAGE_DIR/* $GS_PATH || exit $EXIT_CS_UPLOAD
164 done 184 done
OLDNEW
« no previous file with comments | « gce/uploader_bisect_helper.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698