You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-39Lines changed: 41 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,48 +6,50 @@ The purpose of this package is to extract some git related information (all file
6
6
7
7
It supports 3 main on premise version control service:
8
8
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)
12
12
13
13
## Use the package
14
14
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
+
40
39
## Architecture
41
40
42
41
### Main overview
42
+
43
43
All the git information can be found inside commit that are located inside git repositories
44
44
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.
49
50
50
51
### Implementation
52
+
51
53
The root package is the abstract implementation of the extractor. It contains a Cloner, that clones a git repository.
52
54
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.
53
55
@@ -59,16 +61,16 @@ The cmd/dna-collector package contains the binary code. It reads from CLI and en
0 commit comments