Skip to content

Commit 42c57d3

Browse files
evqmaikelmclauflin
authored andcommitted
README updates, fixes #43 (#79)
* README updates, fixes #43 * fix
1 parent 5deb1f3 commit 42c57d3

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ docker:
2222
docker build -t bat-go:latest .
2323
docker tag bat-go:latest bat-go:$(GIT_VERSION)
2424

25+
docker-up-dev:
26+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
27+
28+
docker-test:
29+
$(eval VAULT_TOKEN = $(shell docker logs grant-vault 2>&1 | grep "Root Token" | tail -1 | cut -d ' ' -f 3 ))
30+
VAULT_TOKEN=$(VAULT_TOKEN) docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm web go test --tags=integration ./...
31+
2532
mac:
2633
GOOS=darwin GOARCH=amd64 make bins
2734

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,35 @@
33
[![Build
44
Status](https://travis-ci.org/brave-intl/bat-go.svg?branch=master)](https://travis-ci.org/brave-intl/bat-go)
55

6-
## Building using docker
7-
8-
You can build a docker image without installing the go toolchain. Ensure docker
9-
is installed then run `make docker`.
10-
116
## Developer Setup
127

138
1. [Install Go 1.12](https://golang.org/doc/install) (NOTE: Go 1.10 and earlier will not work!)
149

15-
2. Run `go get -d github.com/brave-intl/bat-go`.
10+
2. Clone this repo via `git clone https://github.com/brave-intl/bat-go`
11+
12+
3. Build via `make`
13+
14+
## Full environment via docker-compose
15+
16+
Ensure docker and docker-compose are installed.
1617

17-
3. [dep](https://github.com/golang/dep) is used to install the dependencies. If you do not have dep, you need to [install it](https://github.com/golang/dep#setup). On mac:
18-
`brew install dep`
18+
Ensure that your `.env` file is populated with values for each of the
19+
env vars that does not have a default in `docker-compose.yml`.
1920

20-
4. `cd` into `~/go/github.com/brave-intl/bat-go`, then run `dep ensure` to install the dependencies
21+
### Local prod-like environment
2122

22-
5. Build via `make`
23+
To bring up a prod-like environment, run `docker-compose up -d`.
2324

24-
6. Run the server executable `./grant-server`
25+
### Local dev environment
26+
27+
To bring up a dev environment, run `make docker-up`.
28+
29+
This brings up an additional vault service, used for integration testing of
30+
some auxiliary binaries.
31+
32+
You can run the unit and integration tests via `make docker-test`
33+
34+
## Building a prod image using docker
35+
36+
You can build a docker image without installing the go toolchain. Ensure docker
37+
is installed then run `make docker`.

0 commit comments

Comments
 (0)