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

Side by Side Diff: gce/uploader_iteration.sh

Issue 169623002: [chrome-devtools-frontend] Check error codes from curl and gsutil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chrome-devtools-frontend
Patch Set: Created 6 years, 10 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 | « no previous file | 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() {
11 echo "$*" 11 echo "$*"
12 echo '=====================' 12 echo '====================='
13 } 13 }
14 14
15 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 15 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
16 16
17 mark_step 'Moving to the source code directory' 17 mark_step 'Moving to the source code directory'
18 SOURCE_DIR=/uploader/src 18 SOURCE_DIR=/uploader/src
19 cd "$SOURCE_DIR" 19 cd "$SOURCE_DIR"
20 20
21 mark_step 'Updating gyp' 21 mark_step 'Updating gyp'
22 pushd gyp 22 pushd gyp
23 CHROMIUM_GYP_REVISION="$(curl -s http://src.chromium.org/chrome/trunk/src/DEPS | $SCRIPT_DIR/uploader_helper.py --find_project_revision='src/tools/gyp')" 23 CHROMIUM_DEPS=$(curl -fsS http://src.chromium.org/chrome/trunk/src/DEPS) || exit $EXIT_GYP_UPDATE
24 CHROMIUM_GYP_REVISION="$(echo "$CHROMIUM_DEPS" | $SCRIPT_DIR/uploader_helper.py --find_project_revision='src/tools/gyp')"
24 svn cleanup || exit $EXIT_GYP_UPDATE 25 svn cleanup || exit $EXIT_GYP_UPDATE
25 svn up -r $CHROMIUM_GYP_REVISION || exit $EXIT_GYP_UPDATE 26 svn up -r $CHROMIUM_GYP_REVISION || exit $EXIT_GYP_UPDATE
26 popd 27 popd
27 28
28 mark_step 'Getting the last Blink revision for which the frontend has been uploa ded' 29 mark_step 'Getting the last Blink revision for which the frontend has been uploa ded'
29 GS_PATH=gs://chrome-devtools-frontend 30 GS_PATH=gs://chrome-devtools-frontend
30 KNOWN_REVISIONS_DIR="$GS_PATH/revs" 31 KNOWN_REVISIONS_DIR="$GS_PATH/revs"
31 LAST_BLINK_REVISION=$(gsutil ls "$KNOWN_REVISIONS_DIR" | sed -e "s#^$KNOWN_REVIS IONS_DIR/@##" | sort -nr | head -n 1) 32 ALL_UPLOADED_REVS=$(gsutil ls "$KNOWN_REVISIONS_DIR") || exit $EXIT_LAST_UPLOADE D_BLINK_REV
33 LAST_BLINK_REVISION=$(echo "$ALL_UPLOADED_REVS" | sed -e "s#^$KNOWN_REVISIONS_DI R/@##" | sort -nr | head -n 1)
32 if [ -z "$LAST_BLINK_REVISION" ]; then 34 if [ -z "$LAST_BLINK_REVISION" ]; then
33 exit $EXIT_LAST_UPLOADED_BLINK_REV 35 exit $EXIT_LAST_UPLOADED_BLINK_REV
34 fi 36 fi
35 echo "Last uploaded was for Blink revision $LAST_BLINK_REVISION" 37 echo "Last uploaded was for Blink revision $LAST_BLINK_REVISION"
36 38
37 mark_step 'Getting Blink revisions blacklist' 39 mark_step 'Getting Blink revisions blacklist'
38 BLINK_REVISIONS_BLACKLIST_FILE=$GS_PATH/blink_revisions_blacklist 40 BLINK_REVISIONS_BLACKLIST_FILE=$GS_PATH/blink_revisions_blacklist
39 BLINK_REVISIONS_BLACKLIST="" 41 BLINK_REVISIONS_BLACKLIST=""
40 if gsutil ls "$BLINK_REVISIONS_BLACKLIST_FILE"; then 42 if gsutil ls "$BLINK_REVISIONS_BLACKLIST_FILE"; then
41 BLINK_REVISIONS_BLACKLIST=$(gsutil cat "$BLINK_REVISIONS_BLACKLIST_FILE") 43 BLINK_REVISIONS_BLACKLIST=$(gsutil cat "$BLINK_REVISIONS_BLACKLIST_FILE")
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 118
117 zip -9r $ZIP_FILE * || exit $EXIT_ZIP_FRONTEND 119 zip -9r $ZIP_FILE * || exit $EXIT_ZIP_FRONTEND
118 popd 120 popd
119 121
120 ZIP_SHA1=$(sha1sum $ZIP_FILE | awk '{print $1}') 122 ZIP_SHA1=$(sha1sum $ZIP_FILE | awk '{print $1}')
121 mv $ZIP_FILE "$ZIPS_DIR/$ZIP_SHA1.zip" 123 mv $ZIP_FILE "$ZIPS_DIR/$ZIP_SHA1.zip"
122 echo "$ZIP_SHA1" > "$REVS_DIR/@$REVISION" 124 echo "$ZIP_SHA1" > "$REVS_DIR/@$REVISION"
123 125
124 gsutil -m cp -R $LOCAL_STORAGE_DIR/* $GS_PATH || exit $EXIT_CS_UPLOAD 126 gsutil -m cp -R $LOCAL_STORAGE_DIR/* $GS_PATH || exit $EXIT_CS_UPLOAD
125 done 127 done
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698