Skip to content

Commit

Permalink
[+] Technical - A Release now also automatically publish the release …
Browse files Browse the repository at this point in the history
…note to Slack
  • Loading branch information
arnaudbesnier committed Oct 1, 2019
1 parent ae8d1f7 commit 9f72bdc
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEVOPS_SLACK_CHANNEL=
DEVOPS_SLACK_TOKEN=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
.env

# Docker data
/data
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
### Added
- Readme - Add a badge for the NPM package version.
- Schema - Detect enum values for Enums in array schema.
- Technical - A Release now also automatically publish the release note to Slack.

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

### Fixed
- Technical - Fix pre-commit hook to avoid renamed file and add new lina at the end of the file.
- Technical - Fix pre-commit hook to avoid renamed file and add new line at the end of the file.
- ESLint - Fix `search-builder` according to eslint rules.
- ESLint - Fix eslintrc to allow dangle underscore.
- ESLint - Fix `records-decorator` according to eslint rules.
Expand Down
63 changes: 0 additions & 63 deletions bin/deploy.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"moment": "2.24.0"
},
"devDependencies": {
"@forestadmin/devops": "2.0.0",
"babel-cli": "7.0.0-beta.3",
"babel-plugin-transform-runtime": "7.0.0-beta.3",
"babel-preset-env": "7.0.0-beta.3",
Expand All @@ -48,13 +49,12 @@
"mongoose-fixture-loader": "1.0.2",
"onchange": "6.0.0",
"pre-commit": "1.2.2",
"semver": "5.6.0",
"simple-git": "1.65.0"
},
"scripts": {
"build": "./node_modules/babel-cli/bin/babel.js src --out-dir dist && echo '\n\\033[0;34m[+] \\033[0;32mBuild done\\033[0m'",
"build:watch": "onchange 'src/**/*.js' -i -- yarn build",
"deploy": "yarn build && node ./bin/deploy.js",
"release": "yarn build && node ./scripts/release.js",
"test": "./node_modules/mocha/bin/mocha test/**/* --require babel-register --timeout 15000",
"test:watch": "./node_modules/mocha/bin/mocha test/**/* adapters/** services/** utils/** --timeout 15000 --watch",
"lint": "./node_modules/eslint/bin/eslint.js test src",
Expand Down
8 changes: 8 additions & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require('dotenv').config(); // eslint-disable-line
const { ReleaseManager, ReleaseNoteManager } = require('@forestadmin/devops'); // eslint-disable-line

const { DEVOPS_SLACK_TOKEN, DEVOPS_SLACK_CHANNEL } = process.env;
const OPTIONS = { releaseIcon: '🌱', withVersion: true };

new ReleaseManager(OPTIONS).create()
.then(() => new ReleaseNoteManager(DEVOPS_SLACK_TOKEN, DEVOPS_SLACK_CHANNEL, OPTIONS).create());
Loading

0 comments on commit 9f72bdc

Please sign in to comment.