Skip to content

Commit cf0a847

Browse files
committed
Update README.md to match other plugins
1 parent c77f624 commit cf0a847

File tree

1 file changed

+82
-52
lines changed

1 file changed

+82
-52
lines changed

README.md

Lines changed: 82 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,77 @@
11
# Ember-cli-deploy-slack [![Build Status](https://travis-ci.org/ember-cli-deploy/ember-cli-deploy-slack.svg?branch=master)](https://travis-ci.org/ember-cli-deploy/ember-cli-deploy-slack)
22

3-
An ember-cli-deploy-plugin for sending deployment messages to [Slack](https://slack.com/).
3+
> An ember-cli-deploy-plugin for sending deployment messages to [Slack](https://slack.com/).
44
5-
## Usage
5+
<hr/>
6+
**WARNING: This plugin is only compatible with ember-cli-deploy versions >= 0.5.0**
7+
<hr/>
68

7-
This plugin will only work with the upcoming 0.5.0-release of
8-
[ember-cli-deploy](https://github.com/ember-cli/ember-cli-deploy).
9+
## What is an ember-cli-deploy plugin?
910

10-
To setup ember-cli-deploy-slack you need to add a `slack`-entry into your
11-
`deploy.js` configuration file:
11+
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.
1212

13-
```js
14-
module.exports = function(environment) {
15-
var environments = {
16-
"development": {
17-
// ...
18-
"slack": {
19-
"webhookURL": "<your-webhook-URI>",
20-
"channel": "#notifications",
21-
"username": "ember-cli-deploy"
22-
},
23-
// ...
24-
},
25-
26-
"staging": {
27-
// ...
28-
},
29-
30-
"production": {
31-
// ...
32-
}
33-
};
34-
35-
return environments[environment];
36-
};
13+
For more information on what plugins are and how they work, please refer to the [Plugin Documentation][2].
14+
15+
## Quick Start
16+
17+
To get up and running quickly, do the following:
18+
19+
- Install this plugin
20+
21+
```bash
22+
$ ember install ember-cli-deploy-slack
3723
```
3824

25+
- Create a [webhook](https://api.slack.com/incoming-webhooks) in Slack.
26+
27+
- Place the following configuration into `config/deploy.js`
28+
29+
```javascript
30+
ENV.slack = {
31+
webhookURL: '<your-webhook-URI>'
32+
}
33+
```
34+
35+
- Run the pipeline
36+
37+
```bash
38+
$ ember deploy
39+
```
40+
41+
## ember-cli-deploy Hooks Implemented
42+
43+
For detailed information on what plugin hooks are and how they work, please refer to the [Plugin Documentation][2].
44+
45+
- `configure`
46+
- `willDeploy`
47+
- `willBuild`
48+
- `build`
49+
- `didBuild`
50+
- `willUpload`
51+
- `upload`
52+
- `didUpload`
53+
- `willActivate`
54+
- `activate`
55+
- `didActivate`
56+
- `didDeploy`
57+
- `didFail`
58+
59+
## Configuration Options
60+
61+
For detailed information on how configuration of plugins works, please refer to the [Plugin Documentation][2].
62+
63+
###webhookURL
64+
65+
The [webhook](https://api.slack.com/incoming-webhooks) in Slack that the plugin will notify.
66+
67+
###channel
68+
69+
The channel in slack that the notification should be displayed in in Slack.
70+
71+
###username
72+
73+
The username that will send the message in Slack.
74+
3975
## Customization
4076

4177
`ember-cli-deploy-slack` will send default messages on the `didDeploy`- and
@@ -47,34 +83,28 @@ To customize a message you simply add a function to your slack configuration
4783
options that is named the same as the hook notification you want to customize:
4884

4985
```js
50-
module.exports = function(environment) {
51-
var environments = {
52-
"development": {
53-
// ...
54-
"slack": {
55-
"webhookURL": "<your-webhook-URI>",
56-
"channel": "#notifications",
57-
"username": "ember-cli-deploy",
58-
"didDeploy": function(context) {
59-
return function(slack) {
60-
return slack.notify({
61-
text: 'w00t I can haz custumizations!'
62-
});
63-
};
64-
},
65-
},
66-
// ...
67-
},
86+
ENV.slack = {
87+
webhookURL: '<your-webhook-URI>',
88+
channel: '#notifications',
89+
username: 'ember-cli-deploy',
90+
didDeploy: function(context) {
91+
return function(slack) {
92+
return slack.notify({
93+
text: 'w00t I can haz customizations!'
94+
});
95+
};
96+
}
97+
}
6898
```
6999

70-
71100
Notification hooks will be passed the deployment context and the slackNotifier
72101
utility class. The SlackNotifier uses [node-slackr](https://github.com/chenka/node-slackr) under the hood so you can use its `notify`-function accordingly. This enables you to customize your messages in any way possible. You can even add custom properties to the deployment context if that's what you need to do.
73102

74103
Please see the [Slack API documentation for message formatting](https://api.slack.com/docs/formatting)
75104
to see how you can customize your messages.
76105

77-
### Available hooks
106+
## Running Tests
107+
108+
- `npm test`
78109

79-
`willDeploy`, `willBuild`, `build`, `didBuild`, `willActivate`, `activate`,
80-
`didActivate`, `didDeploy`, `didFail`
110+
[2]: http://ember-cli.github.io/ember-cli-deploy/plugins "Plugin Documentation"

0 commit comments

Comments
 (0)