Skip to content

thejbsmith/hubot-heroku-keepalive

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hubot-heroku-keepalive

A hubot script that keeps the hubot Heroko web dyno alive.

Installation

In hubot project repository, run:

npm install hubot-heroku-keepalive --save

Then add hubot-heroku-keepalive to your external-scripts.json:

[
  "hubot-heroku-keepalive"
]

Configuring

hubot-heroku-keepalive is configured by two environment variables:

  • HUBOT_HEROKU_KEEPALIVE_URL - the URL to keepalive
  • HUBOT_HEROKU_KEEPALIVE_INTERVAL - the interval in which to keepalive, in minutes

For hubot-heroku-keepalive to be useful, you must at least set HUBOT_HEROKU_KEEPALIVE_URL. You can find out the value for this by using the Heroku Toolbelt:

heroku apps:info

Copy the Web URL, and then config:set HUBOT_HEROKU_KEEPALIVE_URL:

heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=PASTE_WEB_URL_HERE

If you want to trust a shell snippet from the Internet, here's a one-liner:

heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s  | grep web_url | cut -d= -f2)

Legacy Support

Hubot has for a long time had it's own builtin way to keep its web dyno alive, but this is an extraction of that behavior.

The legacy support uses the HEROKU_URL environment variable instead of HUBOT_HEROKU_KEEPALIVE_URL, so for forward compatability, hubot-heroku-keepalive will also use HEROKU_URL if it's present, and will also disable the legacy keepalive behavior if it's present.

Development

The best way is to use npm link and make sure to point HUBOT_HEROKU_KEEPALIVE_URL at the right place:

hubot-heroku-keepalive$ npm link
hubot-heroku-keepalive$ cd /path/to/your/hubot
hubot$ npm link hubot-heroku-keepalive
hubot$ export HUBOT_HEROKU_KEEPALIVE_URL=http://localhost:8080/
hubot$ bin/hubot

About

A hubot script that keeps the hubot Heroko web dyno alive

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 68.0%
  • JavaScript 21.9%
  • Shell 10.1%