|
1 |
| -## Development |
| 1 | +[](https://travis-ci.org/src-d/gitbase-playground) |
| 2 | +[](https://codecov.io/github/src-d/gitbase-playground) |
| 3 | + |
2 | 4 |
|
3 |
| -### Dependencies |
| 5 | +# Gitbase Playground |
4 | 6 |
|
5 |
| -Launch [bblfshd](https://github.com/bblfsh/bblfshd) and install the drivers. More info in the [bblfshd documentation](https://doc.bblf.sh/user/getting-started.html). |
| 7 | +Web application to query git repositories using SQL. Powered by [gitbase](https://github.com/src-d/gitbase). |
6 | 8 |
|
7 |
| -```bash |
8 |
| -docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd |
9 |
| -docker exec -it bblfshd bblfshctl driver install --all |
10 |
| -``` |
| 9 | + |
11 | 10 |
|
12 |
| -Install [gitbase](https://github.com/src-d/gitbase), populate a repository directory, and start it. |
13 | 11 |
|
14 |
| -```bash |
15 |
| -go get github.com/src-d/gitbase/... |
16 |
| -cd $GOPATH/src/github.com/src-d/gitbase |
17 |
| -make dependencies |
18 |
| -mkdir repos |
19 |
| -git clone https://github.com/src-d/gitbase-playground.git repos/gitbase-playground |
20 |
| -go run cli/gitbase/main.go server -v --git=repos |
21 |
| -``` |
| 12 | +# Usage |
22 | 13 |
|
23 |
| -### Build |
| 14 | +## Dependencies |
24 | 15 |
|
25 |
| -```bash |
26 |
| -go build -o gitbase-playground cmd/server/main.go |
27 |
| -``` |
| 16 | +The playground will run the queries against a [gitbase](https://github.com/src-d/gitbase) server, and will request UASTs to a [bblfsh](https://doc.bblf.sh/) server; both should be accessible for the playground; you can check its default [configuration values](docs/CONTRIBUTING.md#configuration). |
28 | 17 |
|
29 |
| -### Run |
30 | 18 |
|
31 |
| -Use `GITBASEPG_ENV=dev` for extra logs information. |
| 19 | +## Run the Playground |
32 | 20 |
|
33 |
| -Development: |
| 21 | +You can run the app from a docker image, a released binary or installing and building the project. |
34 | 22 |
|
35 |
| -```bash |
36 |
| -GITBASEPG_ENV=dev go run cmd/server/main.go |
37 |
| -``` |
| 23 | +Once the server is running –with its default values–, it will be accessible through: http://localhost:8080 |
38 | 24 |
|
39 |
| -Built binary: |
| 25 | +Read [more about how to run bblfsh and gitbase dependencies](docs/quickstart.md). |
| 26 | + |
| 27 | +### Run with Docker |
40 | 28 |
|
41 | 29 | ```bash
|
42 |
| -GITBASEPG_ENV=dev ./gitbase-playground |
| 30 | +$ docker run -d |
| 31 | + --publish 8080:8080 |
| 32 | + --link gitbase |
| 33 | + --env GITBASEPG_ENV=dev |
| 34 | + --env GITBASEPG_DB_CONNECTION="gitbase@tcp(gitbase:3306)/none?maxAllowedPacket=4194304" |
| 35 | + --name gitbasePlayground |
| 36 | + src-d/gitbase-playground:latest |
43 | 37 | ```
|
44 | 38 |
|
45 |
| -### Run the Tests |
| 39 | + |
| 40 | +### Run the Binary |
| 41 | + |
| 42 | +Download a binary from our [releases section](https://github.com/src-d/gitbase-playground/releases), and run it: |
46 | 43 |
|
47 | 44 | ```bash
|
48 |
| -go test -v server/handler/* |
| 45 | +$ /download/path/gitbase-playground |
49 | 46 | ```
|
| 47 | + |
| 48 | + |
| 49 | +# Contribute |
| 50 | + |
| 51 | +[Contributions](https://github.com/src-d/gitbase-playground/issues) are more than welcome, if you are interested please take a look to our [Contributing Guidelines](docs/CONTRIBUTING.md). You have more information on how to run it locally for [development purposes here](docs/CONTRIBUTING.md#development). |
| 52 | + |
| 53 | + |
| 54 | +# Code of Conduct |
| 55 | + |
| 56 | +All activities under source{d} projects are governed by the [source{d} code of conduct](https://github.com/src-d/guide/blob/master/.github/CODE_OF_CONDUCT.md). |
| 57 | + |
| 58 | + |
| 59 | +## License |
| 60 | + |
| 61 | +GPL v3.0, see [LICENSE](LICENSE) |
0 commit comments