Skip to content

Commit 117e52f

Browse files
author
kuba--
committed
Merge branch 'master' of https://github.com/src-d/gitbase
2 parents af9474f + 847f97f commit 117e52f

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ deploy:
5050
skip_cleanup: true
5151
on:
5252
tags: true
53+
54+
after_deploy:
55+
- DOCKER_PUSH_LATEST=1 make docker-push

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM golang:1.10 as builder
2+
3+
RUN mkdir -p /go/src/github.com/src-d/gitbase
4+
WORKDIR /go/src/github.com/src-d/gitbase
5+
COPY . .
6+
7+
RUN apt-get update && apt-get install libxml2-dev -y
8+
RUN go get github.com/golang/dep/...
9+
RUN dep ensure
10+
RUN cd vendor/gopkg.in/bblfsh/client-go.v2 && make dependencies
11+
RUN go install -v github.com/src-d/gitbase/...
12+
13+
FROM ubuntu:16.04
14+
15+
COPY --from=builder /go/bin/gitbase /bin
16+
RUN mkdir -p /opt/repos
17+
18+
ENV GITBASE_USER=gitbase
19+
ENV GITBASE_PASSWORD=""
20+
EXPOSE 3306
21+
22+
ENV TINI_VERSION v0.17.0
23+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
24+
RUN chmod +x /tini
25+
26+
RUN apt-get update \
27+
&& apt-get install libxml2-dev git -y \
28+
&& apt-get clean \
29+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
30+
31+
ENTRYPOINT ["/tini", "--"]
32+
33+
CMD gitbase server -v \
34+
--host=0.0.0.0 \
35+
--port=3306 \
36+
--user="$GITBASE_USER" \
37+
--password="$GITBASE_PASSWORD" \
38+
--git=/opt/repos

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ $(MAKEFILE):
1212
git clone --quiet --branch $(CI_VERSION) --depth 1 $(CI_REPOSITORY) $(CI_PATH);
1313

1414
-include $(MAKEFILE)
15+
16+
dependencies:
17+
cd vendor/gopkg.in/bblfsh/client-go.v2 && make dependencies

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ Query git repositories with a MySQL interface.
66

77
Check the [Releases](https://github.com/src-d/gitbase/releases) page to download the gitbase binary.
88

9+
### Installing from source
10+
11+
Because gitbase uses [bblfsh's client-go](https://github.com/bblfsh/client-go), which uses cgo, you need to install some dependencies by hand instead of just using `go get`.
12+
13+
```
14+
go get github.com/src-d/gitbase/...
15+
cd $GOPATH/src/github.com/src-d/gitbase
16+
make dependencies
17+
```
18+
919
## Usage
1020

1121
```bash
@@ -45,7 +55,7 @@ gitbase exposes the following tables:
4555
| Name | Columns |
4656
|:------------:|:---------------------------------------------------------------------------------------------------:|
4757
| repositories |id |
48-
| remotes |repository_id, name, push_url,fetch_url,push_refspec,fetch_refspec |
58+
| remotes |repository_id, name, push_url,fetch_url,push_refspec,fetch_refspec |
4959
| commits | hash, author_name, author_email, author_when, comitter_name, comitter_email, comitter_when, message, tree_hash |
5060
| blobs | hash, size, content |
5161
| refs | repository_id, name, hash |

0 commit comments

Comments
 (0)