OLD | NEW |
---|---|
1 #!/usr/bin/env bash | 1 #!/usr/bin/env 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 set -e | 6 set -e |
7 | 7 |
8 http_port=8080 | 8 http_port=8080 |
9 ssh_port=29418 | 9 ssh_port=29418 |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 maximum_page_size='25' | 45 maximum_page_size='25' |
46 password='test-password' | 46 password='test-password' |
47 preferred_email="test-username@test.org" | 47 preferred_email="test-username@test.org" |
48 registered_on=$(date '+%Y-%m-%d %H:%M:%S.000%:::z') | 48 registered_on=$(date '+%Y-%m-%d %H:%M:%S.000%:::z') |
49 username='test-username' | 49 username='test-username' |
50 | 50 |
51 # The python code below for picking the "latest" gerrit release is cribbed and | 51 # The python code below for picking the "latest" gerrit release is cribbed and |
52 # ported from the javascript at: | 52 # ported from the javascript at: |
53 # | 53 # |
54 # http://gerrit-releases.storage.googleapis.com/index.html | 54 # http://gerrit-releases.storage.googleapis.com/index.html |
55 url='https://www.googleapis.com/storage/v1beta2/b/gerrit-releases/o?projection=n oAcl' | 55 url='https://www.googleapis.com/storage/v1/b/gerrit-releases/o?projection=noAcl' |
56 curl --retry 30 --ssl-reqd -s $url | python <(cat <<EOF | 56 curl --retry 30 --ssl-reqd -s $url | python <(cat <<EOF |
57 # Receives Gerrit version via command line and reads json-encoded | 57 # Receives Gerrit version via command line and reads json-encoded |
58 # text from stdin in the format: | 58 # text from stdin in the format: |
59 # | 59 # |
60 # { | 60 # { |
61 # "items": [ | 61 # "items": [ |
62 # { | 62 # { |
63 # "name": "gerrit-<version>.war", | 63 # "name": "gerrit-<version>.war", |
64 # "md5Hash": "<base64 encoded md5sum>", | 64 # "md5Hash": "<base64 encoded md5sum>", |
65 # }, | 65 # }, |
66 # { | 66 # { |
67 # "name": "gerrit-<version>.war", | 67 # "name": "gerrit-<version>.war", |
68 # "md5Hash": "<base64 encoded md5sum>", | 68 # "md5Hash": "<base64 encoded md5sum>", |
69 # }, | 69 # }, |
70 # ... | 70 # ... |
71 # } | 71 # } |
72 # | 72 # |
73 # ...and prints the name and md5sum of the corresponding *.war file. | 73 # ...and prints the name and md5sum of the corresponding *.war file. |
74 | 74 |
75 import json | 75 import json |
76 import re | 76 import re |
77 import sys | 77 import sys |
78 | 78 |
79 requested_version = sys.argv[1] if len(sys.argv) > 1 else None | 79 requested_version = sys.argv[1] if len(sys.argv) > 1 else None |
80 # Disable using -rc versions. This is a temporary hack to avoid | 80 # Disable using -rc versions. This is a temporary hack to avoid |
szager1
2016/03/21 17:18:57
Maybe it's time to check whether this hack can be
| |
81 # picking up version 2.9-rc0, which requires java 7. These lines | 81 # picking up version 2.9-rc0, which requires java 7. These lines |
82 # should be un-commented after this bug is fixed: | 82 # should be un-commented after this bug is fixed: |
83 # https://code.google.com/p/chromium/issues/detail?id=346369 | 83 # https://code.google.com/p/chromium/issues/detail?id=346369 |
84 #gerrit_re = re.compile('gerrit(?:-full)?-([0-9.]+)(-rc[0-9]+)?[.]war') | 84 #gerrit_re = re.compile('gerrit(?:-full)?-([0-9.]+)(-rc[0-9]+)?[.]war') |
85 gerrit_re = re.compile('gerrit(?:-full)?-([0-9.]+)[.]war') | 85 gerrit_re = re.compile('gerrit(?:-full)?-([0-9.]+)[.]war') |
86 j = json.load(sys.stdin) | 86 j = json.load(sys.stdin) |
87 items = [(x, gerrit_re.match(x['name'])) for x in j['items']] | 87 items = [(x, gerrit_re.match(x['name'])) for x in j['items']] |
88 #items = [(x, m.group(1), m.group(2)) for x, m in items if m] | 88 #items = [(x, m.group(1), m.group(2)) for x, m in items if m] |
89 items = [(x, m.group(1), '') for x, m in items if m] | 89 items = [(x, m.group(1), '') for x, m in items if m] |
90 def _cmp(a, b): | 90 def _cmp(a, b): |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 To use SSH API: | 205 To use SSH API: |
206 ssh ${username}@localhost -p ${ssh_port} -i ${rundir}/tmp/id_rsa gerrit | 206 ssh ${username}@localhost -p ${ssh_port} -i ${rundir}/tmp/id_rsa gerrit |
207 | 207 |
208 To enable 'git push' without a password prompt: | 208 To enable 'git push' without a password prompt: |
209 git config credential.helper 'store --file=${rundir}/tmp/.git-credentials' | 209 git config credential.helper 'store --file=${rundir}/tmp/.git-credentials' |
210 | 210 |
211 To stop the server: | 211 To stop the server: |
212 ${rundir}/bin/gerrit.sh stop | 212 ${rundir}/bin/gerrit.sh stop |
213 | 213 |
214 EOF | 214 EOF |
OLD | NEW |