Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubygems/rubygems-chef
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e800ea3720ec
Choose a base ref
...
head repository: rubygems/rubygems-chef
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2e19c201f678
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Jul 18, 2014

  1. WIP hubot

    dwradcliffe committed Jul 18, 2014

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2e19c20 View commit details
Showing with 109 additions and 0 deletions.
  1. +18 −0 cookbooks/rubygems-hubot/files/default/scripts/maintenance.coffee
  2. +7 −0 cookbooks/rubygems-hubot/metadata.rb
  3. +84 −0 cookbooks/rubygems-hubot/recipes/default.rb
18 changes: 18 additions & 0 deletions cookbooks/rubygems-hubot/files/default/scripts/maintenance.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Description:
# Enable or disable maintenance mode on the load balancer.
#
# Dependencies:
# None
#
# Configuration:
#
# Commands:
# hubot turn on|off maintenance for staging|production
#
# Author:
# David Radcliffe

module.exports = (robot) ->

robot.hear /turn (on|off) maintenance( mode)? for (staging|production)/i, (msg) ->
msg.send "I have turned #{msg.match[1]} maintenance mode for the #{msg.match[3]} environment!"
7 changes: 7 additions & 0 deletions cookbooks/rubygems-hubot/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name 'rubygems-hubot'

version '0.0.1'

depends 'chef-vault'
depends 'hubot', '~> 1.0.2'
depends 'rsyslog'
84 changes: 84 additions & 0 deletions cookbooks/rubygems-hubot/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#
# Cookbook Name:: rubygems-hubot
# Recipe:: default
#

include_recipe 'chef-vault'
slack_secrets = chef_vault_item('slack', 'hubot')


node.set['hubot']['version'] = '2.4.6'
node.set['hubot']['scripts_version'] = '2.4.1'
node.set['hubot']['install_dir'] = '/srv/hubot'
node.set['hubot']['adapter'] = 'slack'

node.set['hubot']['dependencies'] = {
'hubot-slack' => '2.1.0',
'hubot-chef' => '>= 0.0.0',
'hubot-capistrano' => '1.0.2'
}

node.set['hubot']['hubot_scripts'] = %w{
ascii.coffee
base64.coffee
beerme.coffee
gemwhois.coffee
github-status.coffee
goooood.coffee
haters.coffee
kittens.coffee
likeaboss.coffee
look-of-disapproval.coffee
nice.coffee
rubygems.coffee
shipit.coffee
sudo.coffee
wunderground.coffee
xkcd.coffee
}

node.set['hubot']['external_scripts'] = %w{
hubot-chef
hubot-capistrano
}

directory '/var/lib/hubot-capistrano'

node.set['hubot']['config'] = {
'HUBOT_SLACK_TOKEN' => slack_secrets['token'],
'HUBOT_SLACK_TEAM' => 'rubygems',
'HUBOT_SLACK_BOTNAME' => 'hubot',
'HUBOT_CAP_DIR' => '/var/lib/hubot-capistrano'
}

include_recipe 'hubot'

remote_directory "#{node['hubot']['install_dir']}/scripts" do
source 'scripts'
files_backup 0
files_owner node['hubot']['user']
files_group node['hubot']['group']
files_mode 00644
owner node['hubot']['user']
group node['hubot']['group']
overwrite true
mode 00755
notifies :restart, 'service[hubot]'
end

include_recipe 'rsyslog'

template '/etc/rsyslog.d/30-hubot.conf' do
source 'rsyslog.conf.erb'
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[rsyslog]'
end

template '/etc/logrotate.d/hubot' do
source 'logrotate.erb'
owner 'root'
group 'root'
mode '644'
end