Reporting for projects across multiple Harvest accounts
Ruby CSS HTML JavaScript CoffeeScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
test
tmp
vendor/assets
.gitignore
.rspec
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
config.ru

README.md

Harvester

Simple Rails app used to consolidate timesheet reports for shared projects across multiple Harvest accounts.

Installation

$ bundle install

Create local database harvester_development

$ rails db:migrate

Rename config/application.yml.example to config/application.yml and fill in Harvest account info.

# Follow the naming convention: "harvest_<namewithoutspaces>_<config_var>"
harvest_mycompany_subdomain: myharvestsubdomain
harvest_mycompany_username:
harvest_mycompany_password:
harvest_mycompany_project_id: '<grab id from project url>'

harvest_partner_subdomain: mypartnersharvestsubdomain
harvest_partner_username:
harvest_partner_password:
harvest_partner_project_id: '<grab id from partner project url>'

harvest_anotherpartner_subdomain: ...

Note: Try restarting Spring if changes aren't taking effect: $ spring stop

Seed your Organizations and Admin users:

$ rails db:seed

Run Redis and Sidekiq in seperate terminals:

$ redis-server
$ bundle exec sidekiq -q default -q mailers

Sync the Harvest data:

$ rails sync:all # This will create a job in Sidekiq but should be picked up right away

Open your app: http://harvester.dev

Deploying to Heroku

You must first install the addons:

$ heroku create
$ heroku ps:scale web=1

# Import config vars from yml
$ figaro heroku:set -e production

# Verify config vars are set (Harvest accounts, REDIS_URL, DATABASE_URL)
$ heroku config

$ git push heroku master
$ heroku run rake db:migrate
$ heroku run rake db:seed
$ heroku run rake sync:all
$ heroku open

Scheduling on Heroku

# Install and launch the addon
$ heroku addons:create scheduler:standard
$ heroku addons:open scheduler

Then just create a new job and add the command rake sync:all

TODO

  • Build config CRUD
  • Fuzzy task name matching between organizations (currently has to be exact)
  • Polling for new timesheet entries only (currently nukes everything)
  • Caching report calculations