npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-deploy-hipchat

v0.3.0

Published

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

Downloads

4

Readme

ember-cli-deploy-hipchat Build Status

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

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