Giter Site home page Giter Site logo

ctisol / capistrano-notify-hubot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snarlysodboxer/capistrano-notify-hubot

0.0 10.0 0.0 19 KB

Send Notifications to Hubot about Capistrano start, finish, etc.

License: GNU General Public License v3.0

Ruby 100.00%

capistrano-notify-hubot's Introduction

capistrano-notify-hubot

A Capistrano plugin to notify hubot about deploys

This is a Capistrano 3.x plugin, and relies on SSH access with passwordless sudo rights.

Installation:

  • gem install capistrano-notify-hubot (Or add it to your Gemfile and bundle install.)
  • Add "require 'capistrano-notify-hubot'" to your Capfile echo "require 'capistrano-notify-hubot'" >> Capfile
  • Add the notify_hubot role to all servers about which you want to be notified.)
  • Add the following settings to your config/deploy.rb file:
##### capistrano-notify-hubot
### ------------------------------------------------------------------
set :deployment_username,           ENV['USER']
before  'deploy:starting',          'notify_hubot:deploy:starting'
after   'deploy:updated',           'notify_hubot:deploy:updated'
after   'deploy:finished',          'notify_hubot:deploy:finished'
set :hubot_room,                    "hackery"
set :hubot_uri,                     "https://127.0.0.1:9001/hubot/message/#{fetch(:hubot_room)}"
set :hubot_username,                "my-user" # hubot basic auth
set :hubot_password,                "my-pass" # hubot basic auth
### ------------------------------------------------------------------
  • To your Hubot instance add a listening hook like:
module.exports = (robot) ->
  robot.router.post '/hubot/message/:room', (req, res) ->
    # your code here to send a message to req.params.room. E.G.:
    # robot.emit "message_slack", req.params.room, req.body.pretext, req.body.title, req.body.text, req.body.color
    res.send "OK\n"

Usage:

  • After setting up your config files during installation, a deploy will notify before starting, after updating, and after finished.
Debugging:
  • You can add the --trace option at the end of a command to see when which tasks are invoked, and when which task is actually executed.
TODO:
  • Fix some silent failures with reaching Hubot.

capistrano-notify-hubot's People

Contributors

snarlysodboxer avatar kishorevaishnav avatar

Watchers

Tom Singer avatar David Chamberlain avatar Justin Myers avatar Palpandi R avatar  avatar  avatar  avatar Kim Schinkel avatar James Cloos avatar Arivarasan L avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.