Guest User

Untitled

a guest
Apr 20th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.09 KB | None | 0 0
  1. ## dependencies
  2.  
  3. 1. `node.js`
  4. 2. `brew` (optional)
  5.  
  6. ### install
  7. 1. run `npm install -g git-stats-importer jira-cmd git-stats` in your terminal
  8. - `git-stats-importer` is used to import git history into `git-stats`
  9. - `git-stats` is used to show your contribution graph
  10. - `jira-cmd` is used to show a specific agile board
  11. 2. you need to setup `jira-cmd` for first use. run the command `jira` in the terminal and insert the following information:
  12. ```
  13. $ jira
  14. Jira URL: xxxxxx
  15. Username: xxxxxx
  16. Password: xxxxxx
  17. Information stored!
  18. ```
  19.  
  20. ## main commands
  21. There are 3 commands that need to run to see the data:
  22. 1. `git-stats-importer --find-repos <repo_directory_path> -e <user_email> &>/dev/null`
  23. This will go over the repo's git history and search for the `<user_email>` commits (can add more than one).
  24. the output is obvuscated using `&>/dev/null`. to see output, remove it.
  25. 2. `git-stats` - display the commit graph should have all the data from git-stats-importer
  26. 3. `jira sprint -r <board_name>` - show bugs of specific agile board.
  27. if you don't have a board for the issues you want to display, you can create one using the following method
  28. 1. go to jira, click on `Issues` and `Search for issues`
  29. 2. add your search term, and click `Save as`. name your search.
  30. 3. on the header, click on `Boards`, and then `View all boards`.
  31. 4. click on `Create board` in the top right corner. In the modal, select `Create a Scrum board`. select `Board from an existing Saved Filter` and click **Next**
  32. 5. give the board an easy name, and search for the saved search we created. click on **Create board**.
  33. 6. Now that you have a board, you can run the command with the board name `jira sprint -r "team omicron bugs"`
  34.  
  35. ## Showing info everytime you open your terminal
  36. Here's a little snippet to show the **contribution graph**, **jira board**, and **status of docker containers**
  37. ```
  38. ###COLOR DEFINITIONS###
  39.  
  40. BLACK='\e[0;30m'
  41. BLUE='\e[0;34m'
  42. GREEN='\e[0;32m'
  43. CYAN='\e[0;36m'
  44. RED='\e[0;31m'
  45. PURPLE='\e[0;35m'
  46. BROWN='\e[0;33m'
  47. LIGHTGRAY='\e[0;37m'
  48. DARKGRAY='\e[1;30m'
  49. LIGHTBLUE='\e[1;34m'
  50. LIGHTGREEN='\e[1;32m'
  51. LIGHTCYAN='\e[1;36m'
  52. LIGHTRED='\e[1;31m'
  53. MAGENTA='\e[1;35m'
  54. YELLOW='\e[1;33m'
  55. LIGHTYELLOW='\e[0;33m'
  56. WHITE='\e[1;37m'
  57. NC='\e[0m' # No Color
  58.  
  59. ###WELCOME SCREEN###
  60. # update commit data for csp-ui
  61. git-stats-importer --find-repos ~/Development/csp-ui -e nkalman@vmware.com &>/dev/null
  62. ###
  63. echo -ne "Today is, "; date
  64. echo;
  65. echo -ne "${NC}~ CSP CONTRIBUTIONS FOR nkalman@vmware.com ~\n==========================================\n" ; git-stats ; jira sprint -r "team omicron bugs" ;
  66. echo -ne "DOCKER STATUS: ${PURPLE}"
  67. echo;
  68. echo -ne ""; docker ps -a
  69. echo; echo;
  70. echo -ne "${NC}";
  71. ```
  72.  
  73. ### additional prints for terminal splash screen
  74. On my terminal splash screen, I also install these dependencies: `brew install toilet fortune cowsay`
  75. 1. `toilet` - shows large text titles
  76. 2. `fortune` - shows a random quote or joke
  77. 3. `cowsay` - prints a cow in ASCII that says the input you give it
  78.  
  79. if you run that command, you can use my full splash screen:
  80. ```
  81. ###WELCOME SCREEN###
  82. # update commit data for csp-ui
  83. git-stats-importer --find-repos ~/Development/csp-ui -e nkalman@vmware.com &>/dev/null
  84. ###
  85. toilet -f pagga "Hello, $USER"
  86. echo -ne "Today is, "; date
  87. echo;
  88. echo -ne "${NC}~ CSP CONTRIBUTIONS FOR nkalman@vmware.com ~\n==========================================\n" ; git-stats ; jira sprint -r "team omicron bugs" ;
  89. echo -ne "DOCKER STATUS: ${PURPLE}"
  90. echo;
  91. echo -ne ""; docker ps -a
  92. echo; echo;
  93. echo -ne "${RED}"; fortune ;
  94. echo -ne "${NC}";
  95. echo;
  96. echo -ne "${NC}";
  97. ```
  98.  
  99. You can also show relevant data from GitHub if you're interested. for that, you can install the following tools:
  100. 1. `npm install -g ghcal` - same contribution graph, happening directly with GitHub data
  101. 2. `brew install ghi` - show issues from a GitHub repo
  102.  
  103. ### how to use
  104. - including contributions for your user on github: `ghcal -u thatkookooguy` (supports most of the same parameters as `git-stats`. run with `-h` to check)
  105. - showing issues related to open pull requests on `vmware/clarity`: `ghi list -f all -p -N greenkeeper -S updated -s open -- vmware/clarity`
  106.  
  107. ## Extras
  108. - you can change the contribution's graph theme using `--light` to make it brighter
  109. - you can show a pie chart of contributions by emails using `git-stats --authors`. Notice this only works for emails you scanned using `git-stats-importer`
  110. - `jira-cmd` have options to actually do commands in jira:
  111. ```
  112. $ jira -h
  113.  
  114. Usage: jira [options] [command]
  115.  
  116. Commands:
  117.  
  118. ls [options] List my issues
  119. start <issue> Start working on an issue.
  120. stop <issue> Stop working on an issue.
  121. review <issue> [assignee] Mark issue as being reviewed [by assignee(optional)].
  122. done [options] <issue> Mark issue as finished.
  123. invalid <issue> Mark issue as finished.
  124. running List issues in progress.
  125. jql [options] [query] Run JQL query
  126. link <from> <to> link issues
  127. search <term> Find issues.
  128. assign <issue> [user] Assign an issue to <user>. Provide only issue# to assign to me
  129. watch <issue> [user] Watch an issue to <user>. Provide only issue# to watch to me
  130. comment <issue> [text] Comment an issue.
  131. show [options] <issue> Show info about an issue
  132. open <issue> Open an issue in a browser
  133. worklog <issue> Show worklog about an issue
  134. worklogadd [options] <issue> <timeSpent> [comment] Log work for an issue
  135. create [project[-issue]] Create an issue or a sub-task
  136. new [options] [key] Create an issue or a sub-task
  137. config [options] Change configuration
  138. sprint [options] Works with sprint boards
  139. With no arguments, displays all rapid boards
  140. With -r argument, attempt to find a single rapid board and display its active sprints
  141. With both -r and -s arguments attempt to get a single rapidboard/ sprint and show its issues. If a single sprint board isnt found, show all matching sprint boards
  142.  
  143. Options:
  144.  
  145. -h, --help output usage information
  146. -V, --version output the version number
  147. ```
  148. - `ghi` can show the body of the issues\pr using the `--verbose` flag
Add Comment
Please, Sign In to add comment