diff --git a/README.md b/README.md index 13e3861..36e47d9 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -131,7 +132,7 @@ Thanks goes to these wonderful people: ## License ```LICENSE -Copyright (c) 2020 Ajit Singh +Copyright (c) 2021 Ajit Singh MIT License