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
So, what is Chat-Ops?
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
What are the benefits?
PHP Berkshire - Aug 2015 https://joind.in/15009
Every day tasks in one place
PHP Berkshire - Aug 2015 https://joind.in/15009
Passive Learning
PHP Berkshire - Aug 2015 https://joind.in/15009
Hide the ‘ugly’
PHP Berkshire - Aug 2015 https://joind.in/15009
Enables/Improves Remote
PHP Berkshire - Aug 2015 https://joind.in/15009
Open Communication
PHP Berkshire - Aug 2015 https://joind.in/15009
Speed & Reliability
PHP Berkshire - Aug 2015 https://joind.in/15009
Group Chat & Services
PHP Berkshire - Aug 2015 https://joind.in/15009
PHP Berkshire - Aug 2015 https://joind.in/15009
Integrations
PHP Berkshire - Aug 2015 https://joind.in/15009
The bot
PHP Berkshire - Aug 2015 https://joind.in/15009
Do I need a bot
PHP Berkshire - Aug 2015 https://joind.in/15009
About a bot
PHP Berkshire - Aug 2015 https://joind.in/15009
Meet Lita
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
Uh-oh! Demo!
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
Demo Wrap up
PHP Berkshire - Aug 2015 https://joind.in/15009
Pitfalls / Cons
PHP Berkshire - Aug 2015 https://joind.in/15009
FUD
(Fear, Uncertainty, Doubt)
PHP Berkshire - Aug 2015 https://joind.in/15009
Noise
PHP Berkshire - Aug 2015 https://joind.in/15009
Over-excited Devs
DON’T
PHP Berkshire - Aug 2015 https://joind.in/15009
Wrap Up
PHP Berkshire - Aug 2015 https://joind.in/15009
Questions?
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/

Chat-Ops : PHP Berkshire

  • 1.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Putting tools in the conversation (All hail our new ‘bot masters)
  • 2.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Dave Baker / @fully_baked Developer at Crew.co Co-founder @PHPDorset Co-founder @PHPSouthCoast Introduction
  • 3.
    PHP Berkshire -Aug 2015 https://joind.in/15009 So, what is Chat-Ops?
  • 4.
    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
  • 5.
    PHP Berkshire -Aug 2015 https://joind.in/15009 What are the benefits?
  • 6.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Every day tasks in one place
  • 7.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Passive Learning
  • 8.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Hide the ‘ugly’
  • 9.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Enables/Improves Remote
  • 10.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Open Communication
  • 11.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Speed & Reliability
  • 12.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Group Chat & Services
  • 13.
    PHP Berkshire -Aug 2015 https://joind.in/15009
  • 14.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Integrations
  • 15.
    PHP Berkshire -Aug 2015 https://joind.in/15009 The bot
  • 16.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Do I need a bot
  • 17.
    PHP Berkshire -Aug 2015 https://joind.in/15009 About a bot
  • 18.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Meet Lita
  • 19.
    PHP Berkshire -Aug 2015 https://joind.in/15009 $ gem install lita $ lita new $ cd lita $ lita start Installing
  • 20.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Anatomy . ├── Gemfile ├── Gemfile.lock └── lita_config.rb 0 directories, 3 files
  • 21.
    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
  • 22.
    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
  • 23.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Uh-oh! Demo!
  • 24.
    PHP Berkshire -Aug 2015 https://joind.in/15009 https://my.slack.com/services/new/lita
  • 25.
    PHP Berkshire -Aug 2015 https://joind.in/15009
  • 26.
    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
  • 27.
    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
  • 28.
    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
  • 29.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Demo Wrap up
  • 30.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Pitfalls / Cons
  • 31.
    PHP Berkshire -Aug 2015 https://joind.in/15009 FUD (Fear, Uncertainty, Doubt)
  • 32.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Noise
  • 33.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Over-excited Devs DON’T
  • 34.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Wrap Up
  • 35.
    PHP Berkshire -Aug 2015 https://joind.in/15009 Questions?
  • 36.
    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/