Dave Newman

Posts tagged minefold minecraft heroku

0 notes &

Run bash scripts on Heroku

So all I wanted was to run a script every 10 minutes to check whether Mojang had gone and released a new version of the Minecraft server. This helps us stay on top of updates at Minefold.

Here’s the check in it’s entirety:

Check the etag on the minecraft server, check it against a value stored in OpenKeyval and if it changed use twilio to send me a text. Simple!

I wanted to run this check on Heroku since most of our stuff is running there days and it makes life so damn easy.

The trick to getting this running on Heroku is to use Keith Rarick’s buildpack: https://github.com/kr/heroku-buildpack-inline

This neat little buildpack allows apps to build themselves. Since all we need on the dyno is bash and curl, our app doesn’t need to install anything. All we need is basically empty scripts in bin/detect, bin/compile and bin/release.

This might be the smallest slug on Heroku.

Check out the code on github

UPDATE Ryan Smith pointed me to his null buildpack which makes it even simpler.

Filed under minefold minecraft heroku