Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.73 KB

README.md

File metadata and controls

64 lines (45 loc) · 1.73 KB

Rewards Birthday extension

This is a ruby library to install on Daily Heroku Scheduler. It will create Reward Bonus for each birthday user. Birthday determined from Rewards API.

Install

# Create Heroku app
heroku create rewards-birthday

# Create Heroku Scheduler
heroku addons:create scheduler:standard

# Open Heroku Scheduler and create daily job with `bin/rake rewards:give_birthday_bonus`
heroku addons:open scheduler

# Create Rollbar addon to track exceptions
heroku addons:create rollbar:free

# Create Little Snitch to track daily execution
# And configure it to define `SNITCH_DAILY`
heroku addons:create deadmanssnitch

# Configure following ENV variables
heroku config:set ROLLBAR_ENV=production
heroku config:set SNITCH_DAILY=
heroku config:set REWARDS_BASE_URI=http://rewards.team/api/v1
heroku config:set REWARDS_BOT_NAME=
heroku config:set REWARDS_BOT_PASSWORD=
heroku config:set REWARDS_BIRTHDAY_TEMPLATE="+1000 Happy Birthday @%{username}"

Usage

# Give bonuses to certain people
emails = %w[[email protected] [email protected]]
RewardsBirthday.create_birthday_bonuses_for(emails)

Or from command line:

bin/rake 'rewards:give_birthday_bonuses_to[[email protected] [email protected]]'

Quality tools

  • bin/quality based on RuboCop
  • .rubocop.yml describes active checks

Develop

bin/build checks your specs and runs quality tools

Credits

Ruby Base is maintained by Timur Vafin. It was written by Flatstack with the help of our contributors.