Skip to content

Instantly share code, notes, and snippets.

@phrawzty
Created June 7, 2013 14:36
Show Gist options
  • Save phrawzty/5729705 to your computer and use it in GitHub Desktop.
Save phrawzty/5729705 to your computer and use it in GitHub Desktop.
pushbot puppet stuff. WARNING: This is totally off the top of my dome. Has not been tested, nor placed anywhere near a parser. :)
define pushbot (
$irc_channel,
$pubsub,
$log_url,
$rev_url,
$repo_url,
$site_name,
$order = 500,
$redis_port = '9388',
$redis_host = 'localhost'
) {
$file = 'pushbot-settings.js'
$bot_name = $name
concat { $file: }
concat::fragment { "${file}_header":
target => $file,
source => 'pushbot-settings.js.head',
order => 1
}
concat::fragment {
target => $file,
content => template('pushbot-settings.js.erb'),
order => $order
}
concat::fragment {
target => $file,
content => "];\n",
order => 999
}
}
{
/* IRC channel. */
channel: '<% irc_channel %>',
/* Bot name. */
name: '<% bot_name %>',
/* Redis host:port */
redis: '<% redis_host %>:<% redis_port %>,
/* Redis pubsub channel name. */
pubsub: '<% pubsub %>',
/* URL to the chief log directory. */
logs: '<% log_url %>',
/* List of nicks to notify after the deploy. */
notify: [],
/* URL that shows the current revision of the site. */
revision: '<% rev_url %>',
/* URL to the github repo. */
github: '<% repo_url %>',
/* Name of the site. */
site: '<% site_name %>'
},
/* managed by puppet */
var options = [
node whatever {
pushbot { 'airmodevpushbot':
irc_channel => '#airmo',
pubsub => 'deploy.airmo.dev',
log_url => 'http://genericadm.private.phx1.mozilla.com/chief/air.dev/logs/',
rev_url => 'https://air-dev.allizom.org/media/revision',
repo_url => 'https://github.com/mozilla/airmozilla',
site_name => 'air-dev',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment