70 lines
2.3 KiB
Ruby
70 lines
2.3 KiB
Ruby
#
|
|
# Cookbook Name:: 5apps-hubot
|
|
# Recipe:: xmpp_schlupp
|
|
#
|
|
# Copyright 2016, Kosmos
|
|
#
|
|
# All rights reserved - Do Not Redistribute
|
|
#
|
|
|
|
firewall_rule 'hubot_express_schlupp_xmpp' do
|
|
port 8083
|
|
protocol :tcp
|
|
command :allow
|
|
end
|
|
|
|
schlupp_xmpp_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', '5apps_schlupp_xmpp')
|
|
|
|
application "schlupp_xmpp" do
|
|
path "/srv/schlupp_xmpp"
|
|
owner "hubot"
|
|
group "hubot"
|
|
|
|
action :deploy
|
|
|
|
before_restart do
|
|
# No hubot-remotestorage-logger, botka takes care of that
|
|
file "#{new_resource.release_path}/external-scripts.json" do
|
|
mode "0640"
|
|
owner "hubot"
|
|
group "hubot"
|
|
content [
|
|
"hubot-auth",
|
|
"hubot-help",
|
|
"hubot-read-tweet",
|
|
"hubot-redis-brain",
|
|
"hubot-rules",
|
|
"hubot-shipit",
|
|
"hubot-plusplus",
|
|
"hubot-tell",
|
|
"hubot-seen",
|
|
"hubot-rss-reader",
|
|
"hubot-openassets",
|
|
"hubot-incoming-webhook",
|
|
"hubot-yubikey-invalidation"
|
|
].to_json
|
|
end
|
|
end
|
|
|
|
repository "git@gitlab.com:5apps/schlupp.git"
|
|
revision "master"
|
|
deploy_key schlupp_xmpp_data_bag_item['deploy_key']
|
|
|
|
nodejs do
|
|
entry_point "/srv/schlupp_xmpp/current/bin/hubot -a xmpp --name schlupp"
|
|
# Use our own systemd service that depends on redis-server
|
|
template "nodejs.systemd.service.erb"
|
|
environment "HUBOT_XMPP_USERNAME" => "schlupp@5apps.com/hubot",
|
|
"HUBOT_XMPP_PASSWORD" => schlupp_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,hilti@muc.5apps.com",
|
|
"HUBOT_XMPP_HOST" => "xmpp.5apps.com",
|
|
"HUBOT_RSS_PRINTSUMMARY" => "false",
|
|
"EXPRESS_PORT" => "8083",
|
|
"HUBOT_RSS_HEADER" => "Update:",
|
|
"HUBOT_AUTH_ADMIN" => "basti,garret,greg",
|
|
"REDIS_URL" => "redis://localhost:6379/5apps_schlupp_xmpp",
|
|
"RS_OPS_TOKEN" => schlupp_xmpp_data_bag_item['rs_ops_token'],
|
|
"WEBHOOK_TOKEN" => schlupp_xmpp_data_bag_item['webhook_token']
|
|
end
|
|
end
|