2016-10-28 18:44:35 +02:00

61 lines
2.1 KiB
Ruby

#
# Cookbook Name:: 5apps-hubot
# Recipe:: xmpp_botka
#
# Copyright 2016, Kosmos
#
# All rights reserved - Do Not Redistribute
#
firewall_rule 'hubot_express_botka_xmpp' do
port 8082
protocol :tcp
command :allow
end
botka_xmpp_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', '5apps_botka_xmpp')
application "botka_xmpp" do
path "/srv/botka_xmpp"
owner "hubot"
group "hubot"
action :deploy
before_restart do
file "#{new_resource.release_path}/external-scripts.json" do
mode "0640"
owner "hubot"
group "hubot"
content [
"hubot-help",
"hubot-remotestorage-logger"
].to_json
end
end
repository "git@gitlab.com:5apps/schlupp.git"
revision "master"
deploy_key botka_xmpp_data_bag_item['deploy_key']
nodejs do
entry_point "/srv/botka_xmpp/current/bin/hubot -a xmpp --name botka"
# Use our own systemd service that depends on redis-server
template "nodejs.systemd.service.erb"
environment "HUBOT_XMPP_USERNAME" => "botka@5apps.com/hubot",
"HUBOT_XMPP_PASSWORD" => botka_xmpp_data_bag_item['password'],
"HUBOT_XMPP_ROOMS" => "5info@muc.5apps.com,5ops@muc.5apps.com,core@muc.5apps.com,deploy@muc.5apps.com,storage@muc.5apps.com,watercooler@muc.5apps.com",
"HUBOT_XMPP_HOST" => "xmpp.5apps.com",
"HUBOT_RSS_PRINTSUMMARY" => "false",
"EXPRESS_PORT" => "8082",
"HUBOT_RSS_HEADER" => "Update:",
"HUBOT_AUTH_ADMIN" => "basti,garret,greg",
"REDIS_URL" => "redis://localhost:6379/5apps_botka_xmpp",
"RS_LOGGER_USER" => "5apps@5apps.com",
"RS_LOGGER_TOKEN" => botka_xmpp_data_bag_item['rs_logger_token'],
"RS_LOGGER_SERVER_NAME" => "5apps",
"RS_OPS_TOKEN" => botka_xmpp_data_bag_item['rs_ops_token'],
"WEBHOOK_TOKEN" => botka_xmpp_data_bag_item['webhook_token']
end
end