Skip to content

Commit e53dd13

Browse files
committed
docs: Format README
Also make coverage report extraction more comprehensible by using cp command to copy the file. https://firetail-io.atlassian.net/browse/FIRE-1839
1 parent 806376e commit e53dd13

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
This Docker image will discover APIs in your GitHub account by scanning for openapi/swagger specifications in your repositories, as well as generating them via static code analysis. It will create an API per repository, and potentially multiple collections for that API, in the FireTail SaaS Platform.
44

5-
6-
75
## Quickstart
86

97
First, clone this repo and build the scanner's image:
108

119
```bash
1210
git clone git@github.com:FireTail-io/github-api-discovery.git
1311
cd github-api-discovery
14-
docker build --rm -t firetail-io/github-api-discovery:latest -f build_setup/Dockerfile . --target runtime
12+
docker build \
13+
--tag firetail-io/github-api-discovery:latest \
14+
--file build_setup/Dockerfile \
15+
--target runtime \
16+
.
1517
```
1618

1719
Make a copy of the provided [config-example.yml](./config-example.yml) and call it `config.yml`, then edit it for your use case.
@@ -31,36 +33,45 @@ Find a full list of environment variables under [Environment Variables](#environ
3133
Once you have created a classic GitHub personal access token and a FireTail app token, you can run the scanner image:
3234

3335
```bash
34-
export GITHUB_TOKEN=YOUR_GITHUB_TOKEN
35-
export FIRETAIL_APP_TOKEN=YOUR_FIRETAIL_APP_TOKEN
36-
docker run --rm -e GITHUB_TOKEN=${GITHUB_TOKEN} -e FIRETAIL_APP_TOKEN=${FIRETAIL_APP_TOKEN} --mount type=bind,source="$(pwd)"/config.yml,target=/config.yml,readonly firetail-io/github-api-discovery:latest
36+
docker run --rm \
37+
--env GITHUB_TOKEN=${YOUR_GITHUB_TOKEN} \
38+
--env FIRETAIL_APP_TOKEN=${YOUR_FIRETAIL_APP_TOKEN} \
39+
--mount type=bind,source="${PWD}"/config.yml,target=/config.yml,readonly \
40+
firetail-io/github-api-discovery:latest
3741
```
3842

39-
40-
4143
## Tests
4244

4345
The tests can be run using the provided Dockerfile:
4446

4547
```bash
46-
docker build --rm -t firetail-io/github-api-discovery:test-python -f build_setup/Dockerfile . --target test-python
48+
docker build --rm \
49+
--tag firetail-io/github-api-discovery:test-python \
50+
--file build_setup/Dockerfile \
51+
--target test-python \
52+
.
4753
```
4854

4955
Tests for the Golang analyser can also be run separately using the provided Dockerfile to yield a html coverage report:
5056

5157
```bash
52-
docker build --rm -t firetail-io/github-api-discovery:test-golang -f build_setup/Dockerfile . --target test-golang
53-
docker run --rm --entrypoint cat firetail-io/github-api-discovery:test-golang coverage.html > golang-coverage.html
58+
docker build \
59+
--tag firetail-io/github-api-discovery:test-golang \
60+
--file build_setup/Dockerfile \
61+
--target test-golang \
62+
.
63+
64+
docker run --rm \
65+
--volume ./coverage:/coverage \
66+
firetail-io/github-api-discovery:test-golang \
67+
cp coverage.html /coverage/golang-coverage.html
5468
```
5569

56-
57-
5870
## Environment Variables
5971

60-
| Variable Name | Description | Required? | Default |
61-
| -------------------- | ------------------------------------------------------------ | --------- | ------------------------------------------------ |
62-
| `GITHUB_TOKEN` | A classic GitHub personal access token. | Yes ✅ | None |
63-
| `FIRETAIL_APP_TOKEN` | An app token from the Firetail SaaS. | Yes ✅ | None |
64-
| `FIRETAIL_API_URL` | The URL of the Firetail SaaS' API. | No ❌ | `"https://api.saas.eu-west-1.prod.firetail.app"` |
65-
| `LOGGING_LEVEL` | The logging level provided to python's [logging](https://docs.python.org/3/library/logging.html#logging-levels) library. | No ❌ | `"INFO"` |
66-
72+
| Variable Name | Description | Required? | Default |
73+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------- | ------------------------------------------------ |
74+
| `GITHUB_TOKEN` | A classic GitHub personal access token. | Yes ✅ | None |
75+
| `FIRETAIL_APP_TOKEN` | An app token from the Firetail SaaS. | Yes ✅ | None |
76+
| `FIRETAIL_API_URL` | The URL of the Firetail SaaS' API. | No ❌ | `"https://api.saas.eu-west-1.prod.firetail.app"` |
77+
| `LOGGING_LEVEL` | The logging level provided to python's [logging](https://docs.python.org/3/library/logging.html#logging-levels) library. | No ❌ | `"INFO"` |

0 commit comments

Comments
 (0)