Apresentação guru slack hubot
-
Upload
vinicius-carvalho -
Category
Software
-
view
55 -
download
5
Transcript of Apresentação guru slack hubot
![Page 1: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/1.jpg)
Ferramentas em produção Slack e HUBOT
![Page 2: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/2.jpg)
Vinicius Carvalho
iOS and Ruby developer | Integrador local CocoaHeads Fortaleza
Você pode me achar nas redes sociais:@viniciusc70
![Page 3: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/3.jpg)
Você usa Slack?
![Page 4: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/4.jpg)
1.TODA COMUNIDADE E SEUS TIMES EM UM SÓ LUGAR.
São alguns exemplos…iosdevbr.slack.comandroiddevbr.slack.comruby-talk.slack.com
Razões para usar Slack
![Page 5: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/5.jpg)
![Page 6: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/6.jpg)
2.INTEGRAÇÕES COM OUTRAS FERRAMENTAS.
![Page 7: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/7.jpg)
![Page 8: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/8.jpg)
3.FERRAMENTA DE BUSCA.
![Page 9: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/9.jpg)
![Page 10: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/10.jpg)
4.COMPARTILHAR ARQUIVOS.
![Page 11: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/11.jpg)
5.CODE SNIPPETS.
![Page 12: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/12.jpg)
![Page 13: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/13.jpg)
6.GRUPOS PRIVADOS.
![Page 14: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/14.jpg)
7.ACESSÍVEL EM MULTI PLATAFORMAS.
![Page 16: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/16.jpg)
1.Instalação Hubot2.Visão do Coffescript3.Hubot Overview4.APIs
![Page 17: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/17.jpg)
BIG INSTALAÇÃO
1. Instalação Node & Redis( brew install node redis )
2. Seguir as instruções do brew’s para rodar o redis3. Install Hubot
( npm install -g hubot )
![Page 18: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/18.jpg)
Encontre uma bela casa para Hubotcd em seu diretório “projects"
run hubot -c airbot para gerar o boilerplatecd airbotnpm install
![Page 19: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/19.jpg)
Hello Worldrun bin/hubot
escreva hubot ping e aperte enter
![Page 20: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/20.jpg)
CREDITS
![Page 21: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/21.jpg)
Uma pequena introdução ao Coffescript :˜
![Page 22: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/22.jpg)
introMessage = (user) -> if user?.name? and user?.hobby? "hello, I am #{response.name}, " + "a #{response.hobby}ist." else message = "Please tell me more about yourself."
message
me = name: "Chiquim" hobby: "Hubot curation"
console.log introMessage(me)
#hello, I am Chiquim, a Hubot curationist
![Page 23: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/23.jpg)
Hubot Structure• Procfile (Heroku startup script)• README.md• bin/ (contains hubot executable)• external-scripts.json (list of packages from npm)• hubot-scripts.json (list of packages from hubot-scripts)• package.json (node package manager metainformation)• scripts/ (custom hubot script directory)
![Page 24: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/24.jpg)
Exemplo Hubot Scriptcreate and edit scripts/goodbye.coffee
![Page 25: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/25.jpg)
module.exports = (robot) ->
robot.hear /(bye | later),?\s(.*)/i, (msg) ->
if root.name.toLowerCase() == msg.match[2].toLowerCase() byeMessage = goodbye(msg.message.user.name) msg.send(byeMessage)
goodbyes = [ "Bye, {name}.", "Later, {name}.", "Take care, {name}."]
goodbye = (name) -> index = parseInt(Math.random() * goodbyes.length) message = goodbyes[index] message.replace(/{name}/, name);
![Page 26: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/26.jpg)
![Page 27: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/27.jpg)
hubot persistanceUm armazenamento simples através do hubot.brain
carregado por redis-brain, mongo-brain, etc.(Você pode encontrar estes em hubot-scripts ou escrever o SEU! )
![Page 28: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/28.jpg)
# you may want to wait until the brain has been initialized# and there is a database connectionrobot.brain.on 'loaded', -> robot.brain.lastAccessed = new Date() robot.brain.seagulls = 12 robot.brain.flowers = { pansies: true, daffodils: false }
# hubot brain runs on events robot.brain.emit 'save'
![Page 29: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/29.jpg)
![Page 30: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/30.jpg)
Deploy
![Page 31: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/31.jpg)
99,526,124 vezes
Você provavelmente fará o deploy no Heroku, não é?
![Page 32: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/32.jpg)
hubot -c criado o Heroku Procfile para você
run Heroku create
deploy com git push heroku masterinicie com heroku ps:scale web=1
(Você deverá rodar o ps:scale somente por uma vez)
![Page 33: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/33.jpg)
Case de sucesso!
RDSTATION
![Page 34: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/34.jpg)
THE CAPYBOT
![Page 35: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/35.jpg)
Place your screenshot here
![Page 36: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/36.jpg)
LINKS INTERESSANTES
1) Criação do seu próprio bot - http://blog.pandorabots.com/putting-your-bot-on-slack/
Integrando IA no seu hubot - https://developer.pandorabots.com/
2 ) Nove ferramentas que não podemos viver sem no Slack - https://keen.io/blog/105456820166/9-slack-hacks-we-couldnt-live-without
3) deploy automático com hubot em Travis CI - http://purevirtual.eu/2015/02/18/deploy-githubs-hubot-for-slack-automatically-with-travis-ci-and-cloudfoundry-part-1/
![Page 37: Apresentação guru slack hubot](https://reader035.fdocumentos.com/reader035/viewer/2022062304/55cc89c2bb61ebc8118b46e5/html5/thumbnails/37.jpg)
Obrigado!