Skip to content

Instantly share code, notes, and snippets.

@joshstrange
Created March 26, 2012 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshstrange/2206333 to your computer and use it in GitHub Desktop.
Save joshstrange/2206333 to your computer and use it in GitHub Desktop.
Pre/Post beanstalk hooks
define('API_KEY', '[YOUR KEY]');
define('API_SEC', '[YOUR SECRET]');
define('YOUR_EMAIL', '[YOUR EMAIL]');
if (!function_exists('curl_init')) {
trigger_error('CURL must be enabled for boxcar_api to function', E_USER_ERROR);
}
// load the api class
require_once 'boxcar_api.php';
// this is needed to stop warnings when using the date functions
date_default_timezone_set('America/Kentucky/Louisville');
$b = new boxcar_api(API_KEY, API_SEC, '[57x57 icon URL]');
if(isset($_GET['pre'])) $b->notify(YOUR_EMAIL, 'Deployment', 'Your deployment has started');
else if(isset($_GET['post'])) $b->notify(YOUR_EMAIL, 'Deployment', 'Your deployment has finished');
else die();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment