@pager/minion-army 1.3.0 → 2.1.0
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.
- package/.github/workflows/release.yml +6 -4
- package/CHANGELOG.md +19 -0
- package/README.md +2 -2
- package/cloudbuild.yaml +39 -0
- package/lib/index.js +1 -1
- package/lib/schema.js +3 -2
- package/package.json +8 -5
- package/test/index.js +1 -1
- package/.circleci/config.yml +0 -61
|
@@ -9,13 +9,15 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
11
|
- name: Checkout
|
|
12
|
-
uses: actions/checkout@
|
|
12
|
+
uses: actions/checkout@v2
|
|
13
|
+
with:
|
|
14
|
+
persist-credentials: false
|
|
13
15
|
- name: Setup Node.js
|
|
14
|
-
uses: actions/setup-node@
|
|
16
|
+
uses: actions/setup-node@v2
|
|
15
17
|
with:
|
|
16
|
-
node-version:
|
|
18
|
+
node-version: 18
|
|
17
19
|
- name: Cache
|
|
18
|
-
uses: actions/cache@
|
|
20
|
+
uses: actions/cache@v2
|
|
19
21
|
with:
|
|
20
22
|
path: ~/.npm
|
|
21
23
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [2.1.0](https://github.com/pagerinc/minion-army/compare/v2.0.0...v2.1.0) (2023-05-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add requeue to the schema ([#453](https://github.com/pagerinc/minion-army/issues/453)) ([74a5c41](https://github.com/pagerinc/minion-army/commit/74a5c4127aee8513500edfe04760bf03ffee057f))
|
|
7
|
+
|
|
8
|
+
# [2.0.0](https://github.com/pagerinc/minion-army/compare/v1.3.0...v2.0.0) (2020-08-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* update deps, move from @hapi/joi to joi ([#234](https://github.com/pagerinc/minion-army/issues/234)) ([fad00f6](https://github.com/pagerinc/minion-army/commit/fad00f6bbb888b824ab52ded956492639c22b496))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* using joi instead of @hapi/joi
|
|
19
|
+
|
|
1
20
|
# [1.3.0](https://github.com/pagerinc/minion-army/compare/v1.2.0...v1.3.0) (2020-07-17)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Microservice Framework for RabbitMQ Workers
|
|
|
5
5
|
|
|
6
6
|
```javascript
|
|
7
7
|
const Army = require('@pager/minion-army');
|
|
8
|
-
const Joi = require('
|
|
8
|
+
const Joi = require('joi');
|
|
9
9
|
|
|
10
10
|
// Refer to lib/schema.js to see valid options
|
|
11
11
|
const manifest = {
|
|
@@ -39,4 +39,4 @@ const manifest = {
|
|
|
39
39
|
const army = Army(manifest);
|
|
40
40
|
|
|
41
41
|
army.start(); // if you provide defaults.autoStart = true this is not needed
|
|
42
|
-
```
|
|
42
|
+
```
|
package/cloudbuild.yaml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
steps:
|
|
2
|
+
- id: npm-install
|
|
3
|
+
name: node:18
|
|
4
|
+
secretEnv: ['NPM_TOKEN']
|
|
5
|
+
entrypoint: npm
|
|
6
|
+
args: ['i', '--quiet', '--package-lock-only']
|
|
7
|
+
|
|
8
|
+
- id: npm-ci
|
|
9
|
+
name: node:18
|
|
10
|
+
secretEnv: ['NPM_TOKEN']
|
|
11
|
+
entrypoint: npm
|
|
12
|
+
args: ['ci', '--quiet']
|
|
13
|
+
|
|
14
|
+
- id: test-unit
|
|
15
|
+
name: node:18
|
|
16
|
+
secretEnv: ['NPM_TOKEN']
|
|
17
|
+
entrypoint: npm
|
|
18
|
+
args: ['test']
|
|
19
|
+
|
|
20
|
+
- id: npm-publish
|
|
21
|
+
name: 'gcr.io/$PROJECT_ID/cloudbuilders/npm:6.13.4'
|
|
22
|
+
secretEnv: ['NPM_TOKEN']
|
|
23
|
+
env:
|
|
24
|
+
- 'TAG_NAME=$TAG_NAME'
|
|
25
|
+
- '_PR_NUMBER=$_PR_NUMBER'
|
|
26
|
+
|
|
27
|
+
timeout: 10m
|
|
28
|
+
|
|
29
|
+
logsBucket: 'gs://$PROJECT_ID-primary-cloudbuild-logs'
|
|
30
|
+
|
|
31
|
+
tags:
|
|
32
|
+
- 'backend'
|
|
33
|
+
- 'npm'
|
|
34
|
+
- 'nodejs'
|
|
35
|
+
|
|
36
|
+
secrets:
|
|
37
|
+
- kmsKeyName: projects/production-197117/locations/global/keyRings/gcb/cryptoKeys/main
|
|
38
|
+
secretEnv:
|
|
39
|
+
NPM_TOKEN: 'CiUA/4lqmXwRPPaGHe+X7TS7mwqARNCw5QFq7yfq7ESHaJrf+tzeElEADvOwrLQvnxCLG2wy+H2vD+DWHMosEgIfzpKNBJAVHX1u4FSwIF5utaN6tMIrLuZB18HnK2SKpsXTPvB/+0Eoz1acnj6WO+slz+GUGUnxefU='
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const Minion = require('@pager/minion');
|
|
4
4
|
const { EventEmitter } = require('events');
|
|
5
5
|
const Jackrabbit = require('@pager/jackrabbit');
|
|
6
|
-
const Joi = require('
|
|
6
|
+
const Joi = require('joi');
|
|
7
7
|
const Schema = require('./schema');
|
|
8
8
|
|
|
9
9
|
const validatorFactory = (handler, schema) => (payload, metadata) => { // eslint-disable-line
|
package/lib/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const Joi = require('
|
|
3
|
+
const Joi = require('joi');
|
|
4
4
|
|
|
5
5
|
const rabbit = Joi.object(); // TODO: validate that rabbit object complies with jackrabbit interface
|
|
6
6
|
const exchange = Joi.object(); // TODO: validate that exchange object complies with jackrabbit interface
|
|
@@ -19,7 +19,8 @@ const config = Joi.object({
|
|
|
19
19
|
rabbit,
|
|
20
20
|
rabbitUrl: Joi.string(),
|
|
21
21
|
prefetch: Joi.number(),
|
|
22
|
-
queueMode: Joi.string()
|
|
22
|
+
queueMode: Joi.string(),
|
|
23
|
+
requeue: Joi.boolean()
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
const worker = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pager/minion-army",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Microservice Framework for RabbitMQ Workers",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"rabbitmq",
|
|
14
14
|
"framework"
|
|
15
15
|
],
|
|
16
|
-
"author": "
|
|
16
|
+
"author": "engineering@pager.com",
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
@@ -24,18 +24,21 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/pagerinc/minion#readme",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@hapi/joi": "17.x",
|
|
28
27
|
"@pager/jackrabbit": "5.x",
|
|
29
28
|
"@pager/minion": "3.x"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@hapi/eslint-config-hapi": "13.x",
|
|
33
32
|
"@hapi/eslint-plugin-hapi": "4.x",
|
|
34
|
-
"@pager/semantic-release-config": "
|
|
33
|
+
"@pager/semantic-release-config": "2.x",
|
|
35
34
|
"ava": "3.x",
|
|
36
35
|
"eslint": "7.x",
|
|
36
|
+
"joi": "^17.2.1",
|
|
37
37
|
"nyc": "15.x",
|
|
38
|
-
"semantic-release": "
|
|
38
|
+
"semantic-release": "21.x"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"joi": "^17.2.0"
|
|
39
42
|
},
|
|
40
43
|
"renovate": {
|
|
41
44
|
"extends": [
|
package/test/index.js
CHANGED
package/.circleci/config.yml
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
|
|
3
|
-
defaults: &defaults
|
|
4
|
-
working_directory: ~/repo
|
|
5
|
-
docker:
|
|
6
|
-
- image: circleci/node:12.18@sha256:3d012ab87cc4e31fe371f4587d9b698cfa21c42784373cc3cb6689d5af6c3a97
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
test:
|
|
10
|
-
<<: *defaults
|
|
11
|
-
steps:
|
|
12
|
-
- checkout
|
|
13
|
-
|
|
14
|
-
- restore_cache:
|
|
15
|
-
keys:
|
|
16
|
-
- dependency-cache-{{ checksum "package.json" }}
|
|
17
|
-
- dependency-cache-
|
|
18
|
-
|
|
19
|
-
- run: npm install
|
|
20
|
-
|
|
21
|
-
- save_cache:
|
|
22
|
-
key: dependency-cache-{{ checksum "package.json" }}
|
|
23
|
-
paths:
|
|
24
|
-
- ./node_modules
|
|
25
|
-
|
|
26
|
-
- run:
|
|
27
|
-
name: Run tests
|
|
28
|
-
command: npm test
|
|
29
|
-
|
|
30
|
-
- persist_to_workspace:
|
|
31
|
-
root: ~/repo
|
|
32
|
-
paths: .
|
|
33
|
-
|
|
34
|
-
deploy:
|
|
35
|
-
<<: *defaults
|
|
36
|
-
steps:
|
|
37
|
-
- attach_workspace:
|
|
38
|
-
at: ~/repo
|
|
39
|
-
- run:
|
|
40
|
-
name: Authenticate with registry
|
|
41
|
-
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
|
|
42
|
-
- run:
|
|
43
|
-
name: Publish package
|
|
44
|
-
command: npm publish
|
|
45
|
-
|
|
46
|
-
workflows:
|
|
47
|
-
version: 2
|
|
48
|
-
test-deploy:
|
|
49
|
-
jobs:
|
|
50
|
-
- test:
|
|
51
|
-
filters:
|
|
52
|
-
tags:
|
|
53
|
-
only: /^v.*/
|
|
54
|
-
- deploy:
|
|
55
|
-
requires:
|
|
56
|
-
- test
|
|
57
|
-
filters:
|
|
58
|
-
tags:
|
|
59
|
-
only: /^v.*/
|
|
60
|
-
branches:
|
|
61
|
-
ignore: /.*/
|