Skip to content

Commit 024fc51

Browse files
committed
Add section about "Development" into README
1 parent 3fc80f9 commit 024fc51

File tree

1 file changed

+39
-14
lines changed

1 file changed

+39
-14
lines changed

README.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,6 @@ It is go gettable ...
3131
$ go get github.com/andygrunwald/go-gerrit
3232
```
3333

34-
... (optional) to run checks and tests:
35-
36-
**Tests Only**
37-
38-
```sh
39-
$ make test
40-
```
41-
42-
**Checks, Tests, Linters, etc**
43-
44-
```sh
45-
$ make vet staticcheck
46-
```
47-
4834
## API / Usage
4935

5036
Have a look at the [GoDoc documentation](https://pkg.go.dev/github.com/andygrunwald/go-gerrit) for a detailed API description.
@@ -233,6 +219,45 @@ func main() {
233219
}
234220
```
235221

222+
## Development
223+
224+
### Running tests and linters
225+
226+
Tests only:
227+
228+
```sh
229+
$ make test
230+
```
231+
232+
Checks, tests and linters
233+
234+
```sh
235+
$ make vet staticcheck test
236+
```
237+
238+
### Local Gerrit setup
239+
240+
For local development, we suggest the usage of the [official Gerrit Code Review docker image](https://hub.docker.com/r/gerritcodereview/gerrit):
241+
242+
```
243+
$ docker run -ti -p 8080:8080 -p 29418:29418 gerritcodereview/gerrit:3.4.1
244+
```
245+
246+
Wait a few minutes until the ```Gerrit Code Review NNN ready``` message appears,
247+
where NNN is your current Gerrit version, then open your browser to http://localhost:8080
248+
and you will be in Gerrit Code Review.
249+
250+
#### Authentication
251+
252+
For local development setups, go to http://localhost:8080/settings/#HTTPCredentials and click `GENERATE NEW PASSWORD`.
253+
Now you can use (only for development purposes):
254+
255+
```go
256+
client.Authentication.SetBasicAuth("admin", "secret")
257+
```
258+
259+
Replace `secret` with your new value.
260+
236261
## Frequently Asked Questions (FAQ)
237262

238263
### How is the source code organized?

0 commit comments

Comments
 (0)