Many companies all over the world uses GitHub Enterprise to work on lot of internal projects : writing code & documentation, fixing & submitting bugs, and so forth. GitHub Enterprise Archive (aka GHE Archive) is a project to record the internal public GitHub Enterprise timeline, archive it, and make it easily accessible for further analysis.
GitHub provides 18 event types, which range from new commits and fork events, to opening new tickets, commenting, and adding members to a project. The activity is aggregated in daily archives, which you can access with any HTTP client. Each archive contains a stream of JSON encoded GitHub events (sample), which you can process in any language.
Query | Command |
---|---|
Your internal activity for November 20, 2013 | wget https://your-ghe-archive/api/events/2013-11-20 |
Your internal activity for November, 2013 | wget https://your-ghe-archive/api/events/2013-11 |
Your internal activity for 2013 | wget https://your-ghe-archive/api/events/2013 |
All your internal activity | wget https://your-ghe-archive/api/events |
Lists are formatted following HAL specifications and you can use page
and per_page
GET parameters to paginate results.
- Clone the project,
- Use Composer to install dependencies with
composer install
in the project directory, - Copy
app/config/parameters.yml.dist
toapp/config/parameters.yml
and edit the parameters, - Setup your favorite web server (with PHP support).
Note : GHE Archive does not use DB storage. To ease the setup, it stores data on file system.
Add the command app/console archive
to your crontab. Due to GitHub limitation, it can archive only the last 300 events. You must choose your cron frequency so that there are no more than 300 events between two cron jobs. The command automatically stops archiving events older than the last run. That means you should prefer to run it too frequently rather than risk losing some events.
GHE Archive provides built-in graphs using Stathat (it's free for 10 stats). If you registered to Stathat, enable the functionality and add your API key in app/config/parameters.yml
. The global activity graph and the per-event graphs are automatically generated.
$ app/console atoum -e test
Developped by the Cytron Team of M6 Web.
Respectfully inspired by GitHub Archive.
GHE Archive is licensed under the MIT license.