Skip to content

Commit

Permalink
Updated readme for version 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitsing committed Jan 5, 2021
1 parent e5bd050 commit eaa8cdf
Showing 1 changed file with 53 additions and 52 deletions.
105 changes: 53 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,19 @@ First of all you need to decide a format for your commit messages e.g.
#Feature [Dev1/Dev2] Your commit message

You can choose any format as long as you are able to extract dev names from the message using a regex.
Once you have decided on the commit message format, create a pairing_matrix.yml file.
Once you have decided on the commit message format, create a ```pairing_matrix.yml``` file.

```yml
authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
github_access_token: 000324cff69wes5613f732c345hn679c0knt509c
github_repos:
- org1/repo1
- org1/repo2
- github_username/my_private_repo
```
#### github_url:
Add github url if you are using github enterprise. This entry can be skipped if you are using github.com.
Mention the API endpoint.

example: http://github.mycompany.com/api/v3/
github:
url: https://api.github.com/
access_token: 000324cgf89weq56132f32c345hn679c0knh501c
repositories:
- org1/repo1
- org1/repo2
- github_username/my_private_repo
```
#### authors_regex:
This regex is used to extract dev names from the commit message. You can verify your regex in irb console using the below command. If your regex is correct it will return an array of dev names.
Expand All @@ -60,65 +57,69 @@ e.g
=> ["Ajit", "Abhishek"]
```

#### github_access_token:
If you want to use private github repos for matrix, then create a github_access_token and give it the repo read permission. Here is how you can create this token: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
#### access_token:
If you want to use private repos for matrix, then create a access token and give it the repo read permission. Here is how you can create the token:

#### github_repos:
List your repos which you want to use for matrix. If you have your repos inside organization then follow the ```org/repo``` format else just mention ```github_username/repo```.
**Github:** https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
**Gitlab:** https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

#### repositories:
List your repos which you want to use for matrix. If you have your repos inside organization then follow the ```org/repo``` format else just mention ```username/repo```.


Now after installing the pairing matrix gem, simply run the ```pairing_matrix``` command in the repo where you have ```pairing_matrix.yml``` file. This command will start a web server.
Then hit the url [localhost:4567/matrix](http://localhost:4567/matrix) or [localhost:4567](http://localhost:4567) in the browser. In case you want to use the json data, hit [http://localhost:4567/data/:days](http://localhost:4567/data/30)

## Some example of pairing_matrix.yml
### Here is a sample pairing_matrix.yml file
# Supported code hosting platforms

```yml
authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
repos:
- /Users/Ajit/projects/project1
- /Users/Ajit/projects/project2
- /Users/Ajit/projects/project3
```
Pairing matrix gem supports below platforms:
* Github
* Gitlab
* Local

The above config will fetch data directly from your local repositories.
Support for bitbucket is coming soon!

### Want to fetch private repos data directly from github?
### Github sample configuration

```yml
```yaml
authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
github_access_token: 000324cff69wes5613f732c345hn679c0knt509c
github_repos:
- org1/repo1
- org1/repo2
- github_username/my_private_repo
```

### Fetching data from public github repos
```yml
authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
github_repos:
- github_username/my_public_repo1
- github_username/my_public_repo2
github:
url: https://api.github.com/
access_token: 000324cff69wes5613f732c345hn679c0knt509c
repositories:
- org1/repo1
- org1/repo2
- github_username/my_private_repo
```
### Fetching data from github enterprise
**Note: Access token is optional if you are using public repositories.**
```yml
github_url: http://git.mycompany.com/api/v3/
### Gitlab sample configuration
```yaml
authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
github_repos:
- github_username/repo1
- github_username/repo2

gitlab:
url: https://gitlab.com/api/v4
access_token: G7EmKQs4swhadZn2sd0T
repositories:
- username/repo1
- username/repo2
```
## Contributors
**Note: Add your custom urls if you are using enterprise version of Github or Gitlab.**
Thanks goes to these wonderful people:
### For local repositories
[Abhishek Thakur](https://github.com/abhikur)
[Sumit Gupta](https://github.com/sumitgpt)
```yaml
authors_regex: ^.*\[([\w]*)(?:\/)?([\w]*)\].*$
local:
repositories:
- /Users/Ajit/projects/project1
- /Users/Ajit/projects/project2
- /Users/Ajit/projects/project3
```
## Contributing
Expand All @@ -131,7 +132,7 @@ Thanks goes to these wonderful people:

## License
```LICENSE
Copyright (c) 2020 Ajit Singh
Copyright (c) 2021 Ajit Singh
MIT License
Expand Down

0 comments on commit eaa8cdf

Please sign in to comment.