Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-deploy-hipchat

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-deploy-hipchat

An ember-cli-deploy-plugin for sending messages to HipChat

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

ember-cli-deploy-hipchat Build Status

An ember-cli-deploy-plugin for sending deployment messages to HipChat.


**WARNING: This plugin is only compatible with ember-cli-deploy versions >= 0.5.0**

What is an ember-cli-deploy plugin?

A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks.

For more information on what plugins are and how they work, please refer to the Plugin Documentation.

Quick Start

To get up and running quickly, do the following:

  • Install this plugin
$ ember install ember-cli-deploy-hipchat
  • Create an authToken in HipChat with the Send Notification permission.

  • Create a roomNotifyToken in HipChat. You can generate one by going to HipChat.com > Rooms tab > Click the room you want > Tokens on the left-hand side > generate a new token with the Send Notification scope.

  • Identify the Room API ID. You can identify this by going to HipChat.com > Rooms tab > Click the room you want > Summary on the left-hand side > API ID in the table.

  • Place the following configuration into config/deploy.js

ENV.hipchat = {
  authToken:       '<your-authToken>',
  roomNotifyToken: '<your-roomNotifyToken>',
  room:            '<your-roomId>'
}

If you use a custom HipChat domain, include it in the configuration.

ENV.hipchat = {
  authToken:       '<your-authToken>',
  roomNotifyToken: '<your-roomNotifyToken>',
  room:            '<your-roomId>',
  endpoint:        '<your-custom-endpoint>'
}
  • Run the pipeline
$ ember deploy

ember-cli-deploy Hooks Implemented

For detailed information on what plugin hooks are and how they work, please refer to the Plugin Documentation.

  • configure
  • willDeploy
  • willBuild
  • build
  • didBuild
  • willUpload
  • upload
  • didUpload
  • willActivate
  • activate
  • didActivate
  • displayRevisions
  • didDeploy
  • didFail

Configuration Options

For detailed information on how configuration of plugins works, please refer to the Plugin Documentation.

###authToken

The authToken to use to auth with HipChat.

###roomNotifyToken

A token for the room you want to notify in HipChat. You can generate one by going to HipChat.com > Rooms tab > Click the room you want > Tokens on the left-hand side > generate a new token with the Send Notification scope.

###room

The Room API ID. You can identify this by going to HipChat.com > Rooms tab > Click the room you want > Summary on the left-hand side > API ID in the table. You (supposedly) can also use the room name, but the ID is safer.

###endpoint (optional)

If you host your own HipChat server, enter the API V2 endpoint for your setup.

Customization

ember-cli-deploy-hipchat will send default messages on the didDeploy-, didActivate- and didFail-hooks on the pipeline. Because every team is different and people tend to customize their automatic hipchat notifications messages can be customized.

To customize a message you simply add a function to your hipchat configuration options that is named the same as the hook notification you want to customize:

ENV.hipchat = {
  authToken:       '<your-authToken>',
  roomNotifyToken: '<your-roomNotifyToken>',
  room:            '<your-roomId>',
  didDeploy: function(context) {
    return function(hipchat) {
      return hipchat.notify('w00t I can haz customizations!', 'yellow');
    };
  }
}

Notification hooks will be passed the deployment context and the hipchatNotifier utility class. The HipchatNotifier uses hipchatter under the hood so you can use its notify-function accordingly.

If you would like to send options beyond message and color (message_type, for example), you can pass options:

didDeploy: function(context) {
  return function(hipchat) {
  	return hipchat.notify({
  	  message: 'what is up @all',
  	  color: 'purple',
  	  message_type: 'text'
  	});
  }
}

Because of the way ember-cli-deploy merges return values of hooks back into the deployment context, you can easily add custom properties to the deployment context if that's what you need to do:

ENV.hipchat = {
  authToken:       '<your-authToken>',
  roomNotifyToken: '<your-roomNotifyToken>',
  room:            '<your-roomId>',

  didDeploy: function(context) {
    return function(hipchat) {
      var myCustomLogic = something;
      var message = "I deployed with " + myCustomLogic + " extra info!";

      return hipchat.notify(message, 'green');
    };
  }
}

Running Tests

  • npm test

Keywords

FAQs

Package last updated on 12 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc