Pro Yearly is on sale from $80 to $50! »

Jenkins & Hubot (with Gtalk) - May 26 2012

Jenkins & Hubot (with Gtalk) - May 26 2012

A quick overview of how you can customize hubot to work with jenkins. Takes you through a simple & advanced script creation to suit your purpose.

4a3cc45f2c6af14087c2e365341b1b02?s=128

sameersegal

May 26, 2012
Tweet

Transcript

  1. Jenkins + Hubot Sameer Segal Artoo - Technology to the

    Rescue www.artoo.in
  2. @artootrills

  3. @artootrills

  4. http://sameersegal.github.com Presentation: Jenkins + Hubot

  5. Team Work Cloud Build Server You 1 2

  6. http://zachholman.com/talk/how-github-uses-github-to- build-github

  7. Hubot (You just got to love this guy)

  8. Installation • Node.js: • http://nodejs.org/#download • NPM • curl http://npmjs.org/install.sh

    | sh • Coffee Script • npm install -g coffee-script • Hubot: • cd /opt • git clone git://github.com/github/hubot.git && cd hubot • npm install
  9. Installation • Gtalk Adapter: • cd /opt/hubot/node_modules/ • git clone

    https://github.com/atmos/hubot-gtalk • Add "hubot-gtalk": ">= 0.0.1" in /opt/hubot/packages.json under dependencies • Launching Hutbot with Gtalk Adapter • export HUBOT_GTALK_USERNAME="bot@domain.com" • export HUBOT_GTALK_PASSWORD="xxxxxxxxxxx" • export HUBOT_GTALK_WHITELIST_DOMAINS="domain.com" • export PORT=5555 • nohup ./opt/hubot/bin/hubot --name Artoo --adapter gtalk &
  10. Build w/o? Params • export HUBOT_JENKINS_URL="http://jenkins.domain.com" • export HUBOT_JENKINS_AUTH=”username:password”

  11. pug me mustache me <name> commit message • Nothing to

    see here, move along • I must have been drunk quote • One advantage of talking to yourself is that you know at least somebody's listening. -- Franklin P. Jones Take a break:
  12. Hubot Scripts https://github.com/github/hubot-scripts

  13. Simple Script # Artoo Cloud Status # # cloud -

    displays a reassuring message module.exports = (robot) -> robot.respond /cloud/i, (msg) -> msg.send "Cloud is doing fine!" TomDoc http://tomdoc.org/ Coffee Script
  14. # Artoo RS # rs list - List servers and

    their state exec = require('child_process').exec; module.exports = (robot) -> robot.respond /rs list/i, (msg) -> user = process.env.RIGHTSCALE_USERNAME pass = process.env.RIGHTSCALE_PASSWORD acct = process.env.RIGHTSCALE_ACCOUNT script = "/root/artoo/rightscale_server_list.sh #{user} #{pass} #{acct}" console.log(script) child = exec script, (error, stdout, stderr) -> msg.send stdout + "\n" + stderr Server Status
  15. Resources & Credits • Installation • Hubot: https://github.com/github/hubot/wiki/Deploying-Hubot-onto- UNIX •

    Gtalk Adapter: https://github.com/github/hubot/wiki/Adapter:-Gtalk • Images • Hubot : http://octodex.github.com/images/hubot.jpg • Jenkins: http://jenkins-ci.org
  16. Thank You www.artoo.in sameersegal.github.com