git-indexer
This isn’t really an indexer, so it is lying a bit right of the bat. What it really
does is look for JIRA issue IDs in commit messages in git, and then looks on github
for comments on those commits, storing it all on the correct issue in a mongodb
There is a second half of this, that is a jira plugin to display this as an issue
panel, but that is not quite ready for prime time, but it is comming
installation
- Install mongodb
- Install node.js
- Use npm to install required node modules:
npm install .
- Create a data directory in the root directory
config
We look for a config.json alongside the app, containing the following:
{
"org": "my_organization", // Your organization, we don't support single users atm
"web": {
"port": 8091 // Port you want the web server to listen to
},
"paths": {
"repo_base": "data/" // Where to store the cloned repos
},
"github_auth": {
"user": myname // github user name
"pw" : topsecret // github password
},
"git_auth": { // pointless duplication
"user": myname // github user name
"pw" : topsecret // github password
},
"mongo": "mongodb://localhost/jira" // The mongodb to connect to
"repos": {
"inc": [
"my-good-repo",
"my-other-repo",
"some-weird-code",
]
},
"git_map_url": "http://mapper/?username=$",
"github_map_url": "http://mapper/?username=$",
}
git_map_url & github_map_url
This is a link to a webservice which given a git email or github username, will return a json like this:
{ username: “some-other-username” }This will be stored in events, as “remoteuser”. We use this to map to JIRA
users, but you can use it for anything you want really.
what is what?
You run node reader.js
to get it all running. It will clone and index all your repos for you.
node webserver.js
starts the web server.
It serves the following URLs:
http://localhost:8091/repos
List of repos defined in the config file
http://localhost:8091/issue/XXX-111
Commits tagged with issue XXX-111
http://localhost:8091/issues_for_repo/my-repo
Issues tagged in commits to repo my-repo