deploy-notify-slack 0.4.1 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +5 -5
  2. package/notify.js +5 -2
  3. package/package.json +5 -4
package/README.md CHANGED
@@ -32,11 +32,11 @@ You can use default message template with the following env variables:
32
32
 
33
33
  - In Bitbucket pipeline or another place you wish to notify about just deployed version of your application you can add dev dependency
34
34
  ```shell
35
- npm i --no-save deploy-notify-slack@^0.3
35
+ npm i --no-save deploy-notify-slack@^0.5
36
36
  ```
37
37
  or major version
38
38
  ```shell
39
- npm i --location=global deploy-notify-slack@^0.3
39
+ npm i --location=global deploy-notify-slack@^0.5
40
40
  ```
41
41
 
42
42
  - run the scrypt with your env variables:
@@ -50,7 +50,7 @@ Bitbucket pipeline example:
50
50
  name: Notify deploy
51
51
  image: node:16-alpine
52
52
  script:
53
- - npm i --location=global deploy-notify-slack@^0.3
53
+ - npm i --location=global deploy-notify-slack
54
54
  - VERSION=$(npm run version --silent)
55
55
  - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} STAGE=dev VERSION=$VERSION node ./node_modules/deploy-notify-slack/notify
56
56
  ```
@@ -62,7 +62,7 @@ or install package globally
62
62
  name: Notify Slack
63
63
  image: node:16-alpine
64
64
  script:
65
- - npm i --location=global deploy-notify-slack@^0.3
65
+ - npm i --location=global deploy-notify-slack
66
66
  - VERSION=$(npm run version --silent)
67
67
  - PWD=$(pwd)
68
68
  - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} STAGE=dev VERSION=$VERSION CHANGELOG_PATH=$PWD/changelog node /usr/local/lib/node_modules/deploy-notify-slack/notify.js
@@ -111,7 +111,7 @@ pipelines:
111
111
  name: Notify Slack
112
112
  image: node:16-alpine
113
113
  script:
114
- - npm i --location=global deploy-notify-slack@^0.3
114
+ - npm i --location=global deploy-notify-slack
115
115
  - VERSION=$(npm run version --silent)
116
116
  - SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} STAGE=dev VERSION=$VERSION node /usr/local/lib/node_modules/deploy-notify-slack/notify.js
117
117
 
package/notify.js CHANGED
@@ -6,6 +6,8 @@ const slackWebHookURL = process.env.SLACK_WEBHOOK_URL;
6
6
  const stage = process.env.STAGE;
7
7
  const version = process.env.VERSION;
8
8
  const title = process.env.TITLE || 'Deployment';
9
+ const color = process.env.COLOR || '7f8583';
10
+ const emoji = process.env.EMOJI || ':rocket:';
9
11
  const customMessage = process.env.CUSTOM_MESSAGE;
10
12
  const changelogPath = process.env.CHANGELOG_PATH || path.join(__dirname, '../../changelog');
11
13
  const failsIfNotSent = process.env.FAILS_IF_NOT_SENT !== undefined
@@ -37,7 +39,7 @@ function notificationBody() {
37
39
  "type": "section",
38
40
  "text": {
39
41
  "type": "mrkdwn",
40
- "text": `:rocket: *${title}*`
42
+ "text": `${emoji} *${title}*`
41
43
  }
42
44
  },
43
45
  {
@@ -85,6 +87,7 @@ function notificationBody() {
85
87
  return {
86
88
  "attachments": [
87
89
  {
90
+ "color": `#${color}`,
88
91
  "blocks": blocks
89
92
  }
90
93
  ]
@@ -236,4 +239,4 @@ function validate() {
236
239
  process.exit(5);
237
240
  }
238
241
  }
239
- })();
242
+ })();
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "deploy-notify-slack",
3
- "version": "0.4.1",
3
+ "version": "0.5.7",
4
+ "private": false,
4
5
  "description": "Send Slack notification about deploy with version comments",
5
6
  "main": "notify.js",
6
7
  "scripts": {
@@ -10,12 +11,12 @@
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
13
- "url": "git+ssh://git@bitbucket.org/omvmike/deploy-notify-slack.git"
14
+ "url": "git+ssh://git@github.com/ClockwiseSoftware/deploy-notify-slack.git"
14
15
  },
15
16
  "author": "mike.onofrienko@clockwise.software",
16
17
  "license": "MIT",
17
18
  "bugs": {
18
- "url": "https://bitbucket.org/omvmike/deploy-notify-slack/issues"
19
+ "url": "https://github.com/ClockwiseSoftware/deploy-notify-slack/issues"
19
20
  },
20
- "homepage": "https://bitbucket.org/omvmike/deploy-notify-slack#readme"
21
+ "homepage": "https://github.com/ClockwiseSoftware/deploy-notify-slack#readme"
21
22
  }