Skip to content

Commit 1f0f190

Browse files
committed
*: Update usable env vars and how to use gitbase with docker in the README
Signed-off-by: Manuel Carmona <[email protected]>
1 parent bd79319 commit 1f0f190

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ make dependencies
8787

8888
## Usage
8989

90+
### Local
9091
```bash
9192
Usage:
9293
gitbase [OPTIONS] <server | version>
@@ -99,12 +100,30 @@ Available commands:
99100
version Show the version information.
100101
```
101102

102-
You can start a server by providing a path which contains multiple git repositories `/path/to/repositories` with this command:
103+
You can start a server providing a path which contains multiple git repositories `/path/to/repositories` with this command:
103104

104105
```
105-
$ gitbase server -v -g /path/to/repositories
106+
$ gitbase server -v -g /path/to/repositories -u gitbase
106107
```
107108

109+
### Docker
110+
111+
You can use the official image from [docker hub](https://hub.docker.com/r/srcd/gitbase/tags/) to quickly run gitbase:
112+
```
113+
docker run --rm --name gitbase -p 3306:3306 -v /my/git/repos:/opt/repos srcd/gitbase:latest
114+
```
115+
116+
If you want to speedup gitbase using indexes, you must run a pilosa container:
117+
```
118+
docker run -it --rm --name pilosa -p 10101:10101 pilosa/pilosa:v0.9.0
119+
```
120+
121+
Then link the gitbase container to the pilosa one:
122+
```
123+
docker run --rm --name gitbase -p 3306:3306 --link pilosa:pilosa -e PILOSA_ENDPOINT="http://pilosa:10101" -v /my/git/repos:/opt/repos srcd/gitbase:latest
124+
```
125+
126+
### Client
108127
A MySQL client is needed to connect to the server. For example:
109128

110129
```bash
@@ -120,15 +139,22 @@ SELECT commit_hash, commit_author_email, commit_author_name FROM commits LIMIT 2
120139
2 rows in set (0.01 sec)
121140
```
122141

142+
If gitbase is running in a container from the official image, you must use `gitbase` as user:
143+
```
144+
mysql -q -u gitbase -h 127.0.0.1
145+
```
146+
123147
### Environment variables
124148

125149
| Name | Description |
126150
|:---------------------------------|:----------------------------------------------------|
127151
| `BBLFSH_ENDPOINT` | bblfshd endpoint, default "127.0.0.1:9432" |
152+
| `PILOSA_ENDPOINT` | pilosa endpoint, default "http://localhost:10101" |
128153
| `GITBASE_BLOBS_MAX_SIZE` | maximum blob size to return in MiB, default 5 MiB |
129154
| `GITBASE_BLOBS_ALLOW_BINARY` | enable retrieval of binary blobs, default `false` |
130155
| `GITBASE_UNSTABLE_SQUASH_ENABLE` | **UNSTABLE** check *Unstable features* |
131156
| `GITBASE_SKIP_GIT_ERRORS` | do not stop queries on git errors, default disabled |
157+
| `GITBASE_INDEX_DIR` | directory where indexes will be persisted |
132158

133159
## Tables
134160

0 commit comments

Comments
 (0)