|
1 | 1 | # Quickstart
|
2 | 2 |
|
3 |
| -You can locally build and deploy `gitbase-playground` and its dependencies using [`docker-compose`](https://docs.docker.com/compose/install/) |
| 3 | +You can locally build and deploy `gitbase-playground` and its dependencies using [`docker-compose`](https://docs.docker.com/compose/install/). |
| 4 | +Docker compose will run three different containers: for the playground frontend itself, gitbase and bblfsh services. It will be the [latest gitbase version](https://hub.docker.com/r/srcd/gitbase/tags/) and [latest bblfsh version](https://hub.docker.com/r/bblfsh/bblfshd/tags/). |
4 | 5 |
|
5 | 6 | If you preffer to run `gitbase-playground` dependencies manually, you can follow [the alternative playground quickstart](quickstart-manually.md)
|
6 | 7 |
|
| 8 | + |
| 9 | +## Download the project |
| 10 | + |
| 11 | +```bash |
| 12 | +$ git clone [email protected]:src-d/gitbase-playground.git gitbase-playground |
| 13 | +$ cd gitbase-playground |
| 14 | +``` |
| 15 | + |
| 16 | +This guide will assume you're running all commands from `gitbase-playground` sources directory |
| 17 | + |
| 18 | + |
7 | 19 | ## Populate the database
|
8 | 20 |
|
9 |
| -Populate a directory with some git repositories to be served by [gitbase](https://github.com/src-d/gitbase): |
| 21 | +It is needed to populate a directory with some git repositories to be served by [gitbase](https://github.com/src-d/gitbase) before running it. |
| 22 | + |
| 23 | +example: |
10 | 24 |
|
11 | 25 | ```bash
|
12 | 26 | $ git clone [email protected]:src-d/gitbase-playground.git ./repos/gitbase-playground
|
13 | 27 | $ git clone [email protected]:src-d/go-git-fixtures.git ./repos/go-git-fixtures
|
14 | 28 | ```
|
15 | 29 |
|
| 30 | +Everytime you want to add a new repository to gitbase, the application should be restarted. |
| 31 | + |
| 32 | + |
16 | 33 | ## Run the application
|
17 | 34 |
|
18 |
| -Once bblfsh and gitbase are running and accessible, you can serve the playground: |
| 35 | +Run the [latest released version of the frontend](https://hub.docker.com/r/srcd/gitbase-playground/tags/): |
19 | 36 |
|
20 | 37 | ```bash
|
21 |
| -$ GITBASEPG_ENV=dev REPOS_FOLDER=./repos GITBASEPG_ENV=dev docker-compose up |
| 38 | +$ GITBASEPG_REPOS_FOLDER=./repos docker-compose up --force-recreate |
22 | 39 | ```
|
23 | 40 |
|
24 |
| -Once the server is running –with its default values–, it will be accessible through: http://localhost:8080 |
| 41 | +If you want to build and run the playground from sources instead of using the last released version you can do so: |
| 42 | + |
| 43 | +<details> |
| 44 | +<pre> |
| 45 | +$ GITBASEPG_REPOS_FOLDER=./repos make compose-serve |
| 46 | +</pre> |
| 47 | +</details> |
| 48 | + |
| 49 | +## Stop the Application |
| 50 | + |
| 51 | +To kill the running containers just `Ctrl+C` |
| 52 | + |
| 53 | +To delete the containers run `docker-compose rm -f` |
25 | 54 |
|
26 |
| -You have more information about the [playground architecture](CONTRIBUTING.md#architecture), [development guides](CONTRIBUTING.md#development) and [configuration options](CONTRIBUTING.md#configuration) in the [CONTRIBUTING.md](CONTRIBUTING.md). |
27 | 55 |
|
| 56 | +## Access to the Playground and Run a Query |
28 | 57 |
|
29 |
| -## Run a Query |
| 58 | +Once the server is running –with its default values–, it will be accessible through: http://localhost:8080 |
30 | 59 |
|
31 | 60 | You will find more info about how to run queries using the playground API on the [rest-api guide](rest-api.md)
|
| 61 | + |
| 62 | + |
| 63 | +## More Info |
| 64 | + |
| 65 | +You have more information about the [playground architecture](CONTRIBUTING.md#architecture), [development guides](CONTRIBUTING.md#development) and [configuration options](CONTRIBUTING.md#configuration) in the [CONTRIBUTING.md](CONTRIBUTING.md). |
0 commit comments