Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Hubot
And You!
Did You Know?
Hubot is a robot
Its pronounced Hew-bot
Hubot is here to help you automate all the menial things
If you know...
How do I run Hubot
Hubot requires Node.JS. (It's what all the cool kids are doing)
$ brew install nodejs (Or download at h...
Hubot can Listen
robot.hear /badger/i, (res) ->
res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS"
Hubot is lis...
Hubot can Reply
robot.respond /open the pod bay doors/i, (res) ->
res.reply "I'm afraid I can't let you do that."
Hubot ca...
PR Assignment Example
Use case: When we open a PR we want all developers to share in the reviewing
of those pull requests....
Testing Hubot
To run a Hubot REPL:
$ ./bin/hubot
Create a test Slack room (or join #hubot-test)
Invite Hubot from within t...
Testing Hubot Continued
HUBOT_SLACK_TOKEN=xxxx ./bin/hubot --adapter slack
The Slack token is obtained when you create you...
Gotchas on Listening
Hubot can hear in two ways:
1)Other users (e.g. humans like you and me)
2)Other integrations (e.g. ro...
Gotchas Continued
A message source might be different than the rendering:
This is formatted, and the source looks like thi...
Contributing
If you think of a useful Hubot feature, then please hack away. The hubot source
code for IH can be found at h...
Prochain SlideShare
Chargement dans…5
×

Hubot

199 vues

Publié le

What is Hubot? How can it help you automate simple tasks?

Publié dans : Technologie
  • Login to see the comments

  • Soyez le premier à aimer ceci

Hubot

  1. 1. Hubot And You!
  2. 2. Did You Know? Hubot is a robot Its pronounced Hew-bot Hubot is here to help you automate all the menial things If you know Javascript/CoffeeScript syntax, you can write Hubot logic! Hubot uses Redis as its “Brain” so you can persist data Influence Health is using Hubot already!
  3. 3. How do I run Hubot Hubot requires Node.JS. (It's what all the cool kids are doing) $ brew install nodejs (Or download at https://nodejs.org/en/) $ npm install -g yo generator-hubot $ mkdir myhubot $ cd myhubot $ yo hubot
  4. 4. Hubot can Listen robot.hear /badger/i, (res) -> res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS" Hubot is listening, and then taking an action in response to that event
  5. 5. Hubot can Reply robot.respond /open the pod bay doors/i, (res) -> res.reply "I'm afraid I can't let you do that." Hubot can reply to the author of a message. Hubot will only reply when @ mentioned
  6. 6. PR Assignment Example Use case: When we open a PR we want all developers to share in the reviewing of those pull requests. 1)Establish a pool of reviewers 2)Map Slack/Github usernames 3)Remember who went last, and assign to the next reviewer Slack has a Github integration that will announce new PRs in a channel. Hubot can be invited to this channel and listen for messages. <Show example assign.coffee>
  7. 7. Testing Hubot To run a Hubot REPL: $ ./bin/hubot Create a test Slack room (or join #hubot-test) Invite Hubot from within the Slack channel (/invite @hubot) Create a web hook at https://api.slack.com/incoming-webhooks $ curl -X POST -H 'Content-type: application/json' --data '{"text":"foo"}' https://hooks.slack.com/services/<hook>
  8. 8. Testing Hubot Continued HUBOT_SLACK_TOKEN=xxxx ./bin/hubot --adapter slack The Slack token is obtained when you create your web hook
  9. 9. Gotchas on Listening Hubot can hear in two ways: 1)Other users (e.g. humans like you and me) 2)Other integrations (e.g. robots like the Github integration) You must define which listening event you want to listen for: robot.hear vs robot.listeners.push
  10. 10. Gotchas Continued A message source might be different than the rendering: This is formatted, and the source looks like this: Pull request submitted: <hyperlink info…> by jeremydefibaugh Pay attention when matching, and use console.log
  11. 11. Contributing If you think of a useful Hubot feature, then please hack away. The hubot source code for IH can be found at https://github.com/BrightWhistle/hubot Or you have a feature request, or issue, report it on the repo, and someone else can pick it up!

×