Skip to content

Commit ab5e84b

Browse files
author
jguerreiro
committed
chore(srcfingerprint): update readme
1 parent 50b3459 commit ab5e84b

File tree

1 file changed

+41
-39
lines changed

1 file changed

+41
-39
lines changed

README.md

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,50 @@ The purpose of this package is to extract some git related information (all file
66

77
It supports 3 main on premise version control service:
88

9-
* GitHub Enterprise
10-
* Gitlab CE and EE
11-
* BitBucket (not supported yet)
9+
- GitHub Enterprise
10+
- Gitlab CE and EE
11+
- BitBucket (not supported yet)
1212

1313
## Use the package
1414

15-
* Build binary
16-
```sh
17-
go build ./cmd/dna-collector
18-
```
19-
* Set env var `GITHUB_TOKEN` or `GITLAB_TOKEN`
20-
```sh
21-
export GITHUB_TOKEN="<token>"
22-
export GITLAB_TOKEN="<token>"
23-
```
24-
* Run and read doc
25-
```sh
26-
./dna-collector -help
27-
```
28-
* Run on a given user/group
29-
```sh
30-
./dna-collector github Uber
31-
./dna-collector -provider-url http://gitlab.example.com gitlab Groupe
32-
```
33-
34-
## Some examples
35-
36-
* Don't forget to build the package: `go build ./cmd/dna-collector`
37-
38-
1. Export all files sha from a GitHub Org to a file with logs: `./dna-collector -verbose -output file_shas_collected_dna.json github GitGuardian`
39-
2. Name params should be passed before positional parameters.
15+
- Build binary
16+
```sh
17+
go build ./cmd/src-fingerprint
18+
```
19+
- Set env var `VCS_TOKEN` to the GitHub Token or GitLab Token
20+
```sh
21+
export VCS_TOKEN="<token>"
22+
```
23+
- Run and read doc
24+
```sh
25+
./src-fingerprint
26+
```
27+
- Run on a given user/group
28+
```sh
29+
./src-fingerprint --provider github --object Uber
30+
./src-fingerprint --provider-url http://gitlab.example.com --provider gitlab --object Groupe
31+
```
32+
33+
## Some examples
34+
35+
- Don't forget to build the package: `go build ./cmd/src-fingerprint`
36+
37+
1. Export all files sha from a GitHub Org to a file with logs: `./src-fingerprint -v --output file_shas_collected_dna.json --provider github GitGuardian`
38+
4039
## Architecture
4140

4241
### Main overview
42+
4343
All the git information can be found inside commit that are located inside git repositories
4444
Our tree element step are the following:
45-
* Collect all repositories URL from the company.
46-
* Clone them with the appropriate authentication.
47-
* Run git commands to extract the information we need on each repository.
48-
* Gather data and store this information in a json file.
45+
46+
- Collect all repositories URL from the company.
47+
- Clone them with the appropriate authentication.
48+
- Run git commands to extract the information we need on each repository.
49+
- Gather data and store this information in a json file.
4950

5051
### Implementation
52+
5153
The root package is the abstract implementation of the extractor. It contains a Cloner, that clones a git repository.
5254
It contains a Pipeline that extracts git information for every git artifact (currently a git file but we could support commit), of every repository of an organization.
5355

@@ -59,16 +61,16 @@ The cmd/dna-collector package contains the binary code. It reads from CLI and en
5961
### Library we use
6062

6163
#### Providers
62-
* GitHub: "github.com/google/go-github/v18/github"
63-
* Gitlab go wrapper: "github.com/xanzy/go-gitlab"
64-
* bitbucket not supported yet
64+
65+
- GitHub: "github.com/google/go-github/v18/github"
66+
- Gitlab go wrapper: "github.com/xanzy/go-gitlab"
67+
- bitbucket not supported yet
6568

6669
#### Cloning
67-
* go-git: https://github.com/src-d/go-git
6870

71+
- go-git: https://github.com/src-d/go-git
6972

7073
### Issues
71-
* Repo size seems not to work on go gitlab wrapper.
72-
* Channels are cheap. Complex design overloading semantics isn't.
73-
7474

75+
- Repo size seems not to work on go gitlab wrapper.
76+
- Channels are cheap. Complex design overloading semantics isn't.

0 commit comments

Comments
 (0)