36
PHP Berkshire - Aug 2015 https://joind.in/15009 Putting tools in the conversation (All hail our new ‘bot masters)

Chat-Ops : PHP Berkshire

Embed Size (px)

Citation preview

Page 1: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Putting tools in the conversation (All hail our new ‘bot masters)

Page 2: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Dave Baker / @fully_baked

Developer at Crew.co

Co-founder @PHPDorset

Co-founder @PHPSouthCoast

Introduction

Page 3: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

So, what is Chat-Ops?

Page 4: Chat-Ops : PHP Berkshire

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

Page 5: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

What are the benefits?

Page 6: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Every day tasks in one place

Page 7: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Passive Learning

Page 8: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Hide the ‘ugly’

Page 9: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Enables/Improves Remote

Page 10: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Open Communication

Page 11: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Speed & Reliability

Page 12: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Group Chat & Services

Page 13: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Page 14: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Integrations

Page 15: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

The bot

Page 16: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Do I need a bot

Page 17: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

About a bot

Page 18: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Meet Lita

Page 19: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

$ gem install lita $ lita new $ cd lita $ lita start

Installing

Page 20: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Anatomy

. ├── Gemfile ├── Gemfile.lock └── lita_config.rb

0 directories, 3 files

Page 21: Chat-Ops : PHP Berkshire

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

Page 22: Chat-Ops : PHP Berkshire

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

Page 23: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Uh-oh! Demo!

Page 24: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

https://my.slack.com/services/new/lita

Page 25: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Page 26: Chat-Ops : PHP Berkshire

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

Page 27: Chat-Ops : PHP Berkshire

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

Page 28: Chat-Ops : PHP Berkshire

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

Page 29: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Demo Wrap up

Page 30: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Pitfalls / Cons

Page 31: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

FUD (Fear, Uncertainty, Doubt)

Page 32: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Noise

Page 33: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Over-excited Devs

DON’T

Page 34: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Wrap Up

Page 35: Chat-Ops : PHP Berkshire

PHP Berkshire - Aug 2015 https://joind.in/15009

Questions?

Page 36: Chat-Ops : PHP Berkshire

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/