You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
12
12
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
37
23
```
38
24
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
+
39
75
## Customization
40
76
41
77
`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
47
83
options that is named the same as the hook notification you want to customize:
48
84
49
85
```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
-
returnfunction(slack) {
60
-
returnslack.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
+
returnfunction(slack) {
92
+
returnslack.notify({
93
+
text:'w00t I can haz customizations!'
94
+
});
95
+
};
96
+
}
97
+
}
68
98
```
69
99
70
-
71
100
Notification hooks will be passed the deployment context and the slackNotifier
72
101
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.
73
102
74
103
Please see the [Slack API documentation for message formatting](https://api.slack.com/docs/formatting)
0 commit comments