Skip to content

Commit 9f72bdc

Browse files
committed
[+] Technical - A Release now also automatically publish the release note to Slack
1 parent ae8d1f7 commit 9f72bdc

File tree

7 files changed

+222
-72
lines changed

7 files changed

+222
-72
lines changed

.env-example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DEVOPS_SLACK_CHANNEL=
2+
DEVOPS_SLACK_TOKEN=

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ build/Release
2525
# Dependency directory
2626
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
2727
node_modules
28+
.env
2829

2930
# Docker data
3031
/data

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
### Added
55
- Readme - Add a badge for the NPM package version.
66
- Schema - Detect enum values for Enums in array schema.
7+
- Technical - A Release now also automatically publish the release note to Slack.
78

89
### Changed
910
- Readme - Add a community section.
1011
- Readme - Remove the Licence section as it is already accessible in the Github page header.
1112

1213
### Fixed
13-
- Technical - Fix pre-commit hook to avoid renamed file and add new lina at the end of the file.
14+
- Technical - Fix pre-commit hook to avoid renamed file and add new line at the end of the file.
1415
- ESLint - Fix `search-builder` according to eslint rules.
1516
- ESLint - Fix eslintrc to allow dangle underscore.
1617
- ESLint - Fix `records-decorator` according to eslint rules.

bin/deploy.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"moment": "2.24.0"
3333
},
3434
"devDependencies": {
35+
"@forestadmin/devops": "2.0.0",
3536
"babel-cli": "7.0.0-beta.3",
3637
"babel-plugin-transform-runtime": "7.0.0-beta.3",
3738
"babel-preset-env": "7.0.0-beta.3",
@@ -48,13 +49,12 @@
4849
"mongoose-fixture-loader": "1.0.2",
4950
"onchange": "6.0.0",
5051
"pre-commit": "1.2.2",
51-
"semver": "5.6.0",
5252
"simple-git": "1.65.0"
5353
},
5454
"scripts": {
5555
"build": "./node_modules/babel-cli/bin/babel.js src --out-dir dist && echo '\n\\033[0;34m[+] \\033[0;32mBuild done\\033[0m'",
5656
"build:watch": "onchange 'src/**/*.js' -i -- yarn build",
57-
"deploy": "yarn build && node ./bin/deploy.js",
57+
"release": "yarn build && node ./scripts/release.js",
5858
"test": "./node_modules/mocha/bin/mocha test/**/* --require babel-register --timeout 15000",
5959
"test:watch": "./node_modules/mocha/bin/mocha test/**/* adapters/** services/** utils/** --timeout 15000 --watch",
6060
"lint": "./node_modules/eslint/bin/eslint.js test src",

scripts/release.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require('dotenv').config(); // eslint-disable-line
2+
const { ReleaseManager, ReleaseNoteManager } = require('@forestadmin/devops'); // eslint-disable-line
3+
4+
const { DEVOPS_SLACK_TOKEN, DEVOPS_SLACK_CHANNEL } = process.env;
5+
const OPTIONS = { releaseIcon: '🌱', withVersion: true };
6+
7+
new ReleaseManager(OPTIONS).create()
8+
.then(() => new ReleaseNoteManager(DEVOPS_SLACK_TOKEN, DEVOPS_SLACK_CHANNEL, OPTIONS).create());

0 commit comments

Comments
 (0)