Upload
fullybaked
View
417
Download
0
Embed Size (px)
Citation preview
PHP Berkshire - Aug 2015 https://joind.in/15009
Putting tools in the conversation (All hail our new ‘bot masters)
PHP Berkshire - Aug 2015 https://joind.in/15009
Dave Baker / @fully_baked
Developer at Crew.co
Co-founder @PHPDorset
Co-founder @PHPSouthCoast
Introduction
PHP Berkshire - Aug 2015 https://joind.in/15009
“ChatOps is all about conversation-driven development. By bringing your tools into your conversations and using a chat bot modified to work with key plugins and scripts, teams can automate tasks and collaborate, working better, cheaper and faster.
Eric Sigler - Pagerduty
PHP Berkshire - Aug 2015 https://joind.in/15009
PHP Berkshire - Aug 2015 https://joind.in/15009
$ gem install lita $ lita new $ cd lita $ lita start
Installing
PHP Berkshire - Aug 2015 https://joind.in/15009
Anatomy
. ├── Gemfile ├── Gemfile.lock └── lita_config.rb
0 directories, 3 files
PHP Berkshire - Aug 2015 https://joind.in/15009
source "https://rubygems.org"
gem "lita"
# Uncomment to use the HipChat adapter # gem "lita-hipchat"
# Uncomment to use the IRC adapter # gem "lita-irc"
# Add handlers to give Lita new functionality. # For example: # gem "lita-google-images" # gem "lita-karma"
Gemfile
PHP Berkshire - Aug 2015 https://joind.in/15009
Lita.configure do |config| # The name your robot will use. config.robot.name = "Lita"
# The severity of messages to log. Options are: # :debug, :info, :warn, :error, :fatal # Messages at the selected level and above will be logged. config.robot.log_level = :info
# An array of user IDs that are considered administrators. These users # the ability to add and remove other users from authorization groups. # What is considered a user ID will change depending on which adapter you use. # config.robot.admins = ["1", "2"]
# The adapter you want to connect with. Make sure you've added the # appropriate gem to the Gemfile. config.robot.adapter = :shell
## Example: Set configuration for any loaded handlers. See the handler's ## documentation for options. # config.handlers.some_handler.some_config_key = "value" end
Config
PHP Berkshire - Aug 2015 https://joind.in/15009
https://my.slack.com/services/new/lita
PHP Berkshire - Aug 2015 https://joind.in/15009
PHP Berkshire - Aug 2015 https://joind.in/15009
$ lita help 2.2.2 5-hack-handler c7ea87f Commands: lita adapter NAME # Generates a new Lita adapter lita extension NAME # Generates a new Lita extension lita handler NAME # Generates a new Lita handler lita help [COMMAND] # Describe available commands or one specific command lita new NAME # Generates a new Lita project (default name: lita) lita start # Starts Lita lita version # Outputs the current version of Lita
Lita helps you
PHP Berkshire - Aug 2015 https://joind.in/15009
Scaffold of a handler#lita-pary.rb module Lita module Handlers class Party < Handler route(/party/, :because, command: false, help: { "Party!" => "Lita loves to party!" })
def because(response) response.reply "Party? P.A.R.T.Y! Because I gotta!" end
end
Lita.register_handler(Party) end end
PHP Berkshire - Aug 2015 https://joind.in/15009
Adding handler to Lita
#lita_config.rb require_relative './lita-party'
Lita.configure do |config| # The name your robot will use. config.robot.name = "Lita"
# —- snip —— end
PHP Berkshire - Aug 2015 https://joind.in/15009
FUD (Fear, Uncertainty, Doubt)
PHP Berkshire - Aug 2015 https://joind.in/15009
Image Credits[Robot] http://www.techweekeurope.co.uk/workspace/us-scientists-plan-on-demand-robots-71620/attachment/retro-robot-toy
[Questionmark person] http://www.onlygoodpix.com/photo/q/question-mark-person/1/
Resources[Lita] https://www.lita.io/
[Lita docs] http://docs.lita.io/getting-started/
[Lita plugins] https://www.lita.io/plugins
[Jesse Newland Talk] https://www.youtube.com/watch?v=NST3u-GjjFw
[Dev Ops Days Rockies 2015 videos] http://livestream.com/devopsdaysorg/Rockies2015
[ChatOps for Dummies] https://victorops.com/chatops-for-dummies/