OLD | NEW |
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 if [ -n "$1" ]; then | 6 if [ -n "$1" ]; then |
7 rundir="$1" | 7 rundir="$1" |
8 else | 8 else |
9 rundir=$(mktemp -d) | 9 rundir=$(mktemp -d) |
10 fi | 10 fi |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 INSERT INTO ACCOUNT_EXTERNAL_IDS (ACCOUNT_ID, EMAIL_ADDRESS, PASSWORD) VALUES ($
{account_id}, '${preferred_email}', '${password}'); | 122 INSERT INTO ACCOUNT_EXTERNAL_IDS (ACCOUNT_ID, EMAIL_ADDRESS, PASSWORD) VALUES ($
{account_id}, '${preferred_email}', '${password}'); |
123 INSERT INTO ACCOUNT_GROUP_MEMBERS (ACCOUNT_ID, GROUP_ID) VALUES (${account_id},
1); | 123 INSERT INTO ACCOUNT_GROUP_MEMBERS (ACCOUNT_ID, GROUP_ID) VALUES (${account_id},
1); |
124 EOF | 124 EOF |
125 | 125 |
126 # Create a netrc file to authenticate as the first user. | 126 # Create a netrc file to authenticate as the first user. |
127 mkdir -p "${rundir}/tmp" | 127 mkdir -p "${rundir}/tmp" |
128 cat <<EOF > "${rundir}/tmp/.netrc" | 128 cat <<EOF > "${rundir}/tmp/.netrc" |
129 machine localhost login ${username} password ${password} | 129 machine localhost login ${username} password ${password} |
130 EOF | 130 EOF |
131 | 131 |
| 132 # Create a .git-credentials file, to enable password-less push. |
| 133 cat <<EOF > "${rundir}/tmp/.git-credentials" |
| 134 http://${username}:${password}@localhost:8080 |
| 135 EOF |
| 136 |
132 echo | 137 echo |
133 echo "To start gerrit server:" | 138 echo "To start gerrit server:" |
134 echo " ${rundir}/bin/gerrit.sh start" | 139 echo " ${rundir}/bin/gerrit.sh start" |
135 echo | 140 echo |
136 echo "To use the REST API:" | 141 echo "To use the REST API:" |
137 echo " curl --netrc-file ${rundir}/tmp/.netrc http://localhost:8080/<endpoint>" | 142 echo " curl --netrc-file ${rundir}/tmp/.netrc http://localhost:8080/<endpoint>" |
138 echo | 143 echo |
| 144 echo "To enable 'git push' without a password prompt:" |
| 145 echo " git config credential.helper 'store --file=${rundir}/tmp/.git-credential
s'" |
| 146 echo |
139 echo "To stop the server:" | 147 echo "To stop the server:" |
140 echo " ${rundir}/bin/gerrit.sh stop" | 148 echo " ${rundir}/bin/gerrit.sh stop" |
141 echo | 149 echo |
OLD | NEW |