diff options
author | Hal Canary <halcanary@google.com> | 2018-04-18 15:35:18 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-18 19:39:44 +0000 |
commit | 64f75eecdd09c83c5bd59511c3bb9f53c256d587 (patch) | |
tree | 627631bac834e0cb40799c31c80c2a3b3722b4f4 /tools/skqp | |
parent | 0d129aa78255e2a1efca31094225b607b13361e1 (diff) |
SkQP: speed up tools/skqp/make_apk_list\
NoTry: true
Change-Id: I94852a9375329a6c9df269004b89efb48d2e4691
Reviewed-on: https://skia-review.googlesource.com/122083
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tools/skqp')
-rwxr-xr-x | tools/skqp/make_apk_list | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/tools/skqp/make_apk_list b/tools/skqp/make_apk_list index 9574101c08..75f7a3c6b5 100755 --- a/tools/skqp/make_apk_list +++ b/tools/skqp/make_apk_list @@ -4,12 +4,18 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +set -e + BRANCH="${1:-origin/skqp/dev}" COUNT="${2:-40}" -DST=$(mktemp) +cd "$(dirname "$0")/../.." + +EXTANT="$(mktemp "${TMPDIR:-/tmp}/extant.XXXXXXXXXX")" +BUCKET='skia-skqp' +gsutil ls "gs://$BUCKET" > $EXTANT -cat > "$DST" << EOF +cat << EOF <!DOCTYPE html> <html lang="en"> <head> @@ -37,24 +43,16 @@ td { padding:12px 6px; } EOF for commit in $(git log "$BRANCH" -${COUNT} -\-format=%H) ; do - printf '.' >&2 short="$(git log -1 -\-format=%h $commit)" - url="https://storage.googleapis.com/skia-skqp/skqp-universal-${short}.apk" - if [ 200 -ne "$(curl -s -o /dev/null -w "%{http_code}" "$url")" ] ; then + name="${BUCKET}/skqp-universal-${short}.apk" + if ! grep -q "gs://$name" "$EXTANT"; then continue fi + url="https://storage.googleapis.com/$name" date=$(TZ='' git log -\-date='format-local:%Y-%m-%d %H:%M:%S %Z' -1 $commit -\-format=%cd) subj=$(git log -1 $commit -\-format='%<(50,trunc)%s' | sed 's/ *$//') - commit_url="https://skia.googlesource.com/skia/+/${commit}" - { - printf '<tr>\n<td><a href="%s">skqp-universal-%s.apk</a></td>\n' "$url" "$short" - printf '<td>%s</td>\n<td><a href="%s">%s</a></td>\n</tr>\n' "$date" "$commit_url" "$subj" - } >> "$DST" + printf '<tr>\n<td><a href="%s">skqp-universal-%s.apk</a></td>\n' "$url" "$short" + printf '<td>%s</td>\n<td><a href="%s">%s</a></td>\n</tr>\n' "$date" "$commit_url" "$subj" done -printf '</body>\n</head>\n' >> "$DST" - -echo - -echo 'gsutil -h "Content-Type:text/html" cp' \"$DST\" gs://skia-skqp/apklist -echo 'https://storage.googleapis.com/skia-skqp/apklist' +printf '</body>\n</head>\n' |