Snitch is a dev-server git status reporting tool. It was designed to track the current status of many repos across many linux-based servers. It does this with the help of these tools which should already be installed on your dev servers:
- Git CLI
- Curl
- Cron
Snitch-on-Rails is a Rails-based app, and the easiest way to get a Rails app up and running is to deploy it to Heroku. Here's how to do it.
- Create a heroku account (http://www.heroku.com)
- Install the Heroku command line on your local machine (https://devcenter.heroku.com/articles/heroku-command-line)
- $ git clone https://github.com/btwelch/snitch-on-rails.git
- $ cd snitch-on-rails
- $ heroku create
- Copy the Heroku server name you are given
- $ git push heroku master
- $ heroku run rake db:migrate
Now you should be up and running with a Snitch server on Heroku. Nicely done!
But, wait! There's a bit more to do!
In order for Snitch to know the status of your repos, each dev server must be setup with a cron process that periodically invokes the Snitch "Client" shell script. Here's how to do that:
- $ ssh user@yourserver
- yourserver$ cd opt/
- yourserver$ vim snitch.sh
- Insert the contents of this project's file client/snitch.sh into the vim editor
- Change "host" of the snitch.sh script to be the Heroku server name you copied from step #6 in "Setup on Heroku"
- Setup a curl request for every repo on your server (see Setup of Repo Reporting for details)
- Save the snitch.sh script
- yourserver$ chmod 777 snitch.sh
- yourserver$ crontab -e
- Insert */5 * * * * /opt/snitch.sh to the crontab file.
- Save the crontab file and exit.
Now you should have a shell script that is run every 5 minutes that reports the repo statuses to the Snitch server. You can also force an instant report to Snitch server by running ./snitch.sh command on your dev server.
Check it out at: {your Heroku server name}/servers
Coming soon.