Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

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.

sameersegal

May 26, 2012
Tweet

More Decks by sameersegal

Other Decks in Technology

Transcript

  1. 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
  2. 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="[email protected]" • export HUBOT_GTALK_PASSWORD="xxxxxxxxxxx" • export HUBOT_GTALK_WHITELIST_DOMAINS="domain.com" • export PORT=5555 • nohup ./opt/hubot/bin/hubot --name Artoo --adapter gtalk &
  3. 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:
  4. 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
  5. # 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
  6. 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