@govuk-pay/cli 0.0.62 → 0.0.64
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/package.json +1 -1
- package/readme.md +14 -0
- package/resources/legacy-ruby-cli/.ruby-version +1 -1
- package/resources/legacy-ruby-cli/Gemfile.lock +3 -3
- package/resources/pay-local/templates/docker-compose.hbs +2 -0
- package/src/commands/local/config/pay_local_cluster.js +7 -5
- package/src/commands/local/subcommands/up.js +4 -3
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -83,6 +83,20 @@ clusters:
|
|
|
83
83
|
- selfservice
|
|
84
84
|
- frontend
|
|
85
85
|
```
|
|
86
|
+
Custom clusters also support pre-defined options, which can be configured by setting `options` on the cluster config, e.g.
|
|
87
|
+
```yaml
|
|
88
|
+
clusters:
|
|
89
|
+
- name: my-cool-cluster
|
|
90
|
+
apps:
|
|
91
|
+
- connector
|
|
92
|
+
- selfservice
|
|
93
|
+
- frontend
|
|
94
|
+
options:
|
|
95
|
+
mountLocalNodeApps: true
|
|
96
|
+
local:
|
|
97
|
+
- selfservice
|
|
98
|
+
```
|
|
99
|
+
These will be passed in automatically on running `pay local up --cluster my-cool-cluster`
|
|
86
100
|
|
|
87
101
|
## Vulnerability Disclosure
|
|
88
102
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.2.2
|
|
@@ -1314,10 +1314,10 @@ GEM
|
|
|
1314
1314
|
mime-types (3.4.1)
|
|
1315
1315
|
mime-types-data (~> 3.2015)
|
|
1316
1316
|
mime-types-data (3.2022.0105)
|
|
1317
|
-
mini_portile2 (2.8.
|
|
1317
|
+
mini_portile2 (2.8.8)
|
|
1318
1318
|
minitest (5.19.0)
|
|
1319
1319
|
netrc (0.11.0)
|
|
1320
|
-
nokogiri (1.
|
|
1320
|
+
nokogiri (1.18.3)
|
|
1321
1321
|
mini_portile2 (~> 2.8.2)
|
|
1322
1322
|
racc (~> 1.4)
|
|
1323
1323
|
optimist (3.0.1)
|
|
@@ -1334,7 +1334,7 @@ GEM
|
|
|
1334
1334
|
process-group
|
|
1335
1335
|
process-terminal (0.2.0)
|
|
1336
1336
|
ffi
|
|
1337
|
-
racc (1.
|
|
1337
|
+
racc (1.8.1)
|
|
1338
1338
|
rainbow (3.1.1)
|
|
1339
1339
|
regexp_parser (2.8.0)
|
|
1340
1340
|
rest-client (2.1.0)
|
|
@@ -189,7 +189,9 @@ services:
|
|
|
189
189
|
{{#ifBoth localBuild entrypointOverrideLocal}}
|
|
190
190
|
entrypoint: {{{../entrypointOverrideLocal}}}
|
|
191
191
|
{{else}}
|
|
192
|
+
{{#unless ../isBundled}}
|
|
192
193
|
entrypoint: "npx nodemon --inspect=0.0.0.0:{{../debugPort}}"
|
|
194
|
+
{{/unless}}
|
|
193
195
|
{{/ifBoth}}
|
|
194
196
|
ports:
|
|
195
197
|
- "{{port}}:{{port}}"
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.loadCustomClusterConfig = exports.loadServicesConfig = exports.loadClusterConfig = exports.PayLocalCluster = exports.
|
|
6
|
+
exports.loadCustomClusterConfig = exports.loadServicesConfig = exports.loadClusterConfig = exports.PayLocalCluster = exports.CUSTOM_CLUSTERS = exports.CUSTOM_CLUSTERS_PATH = exports.CLUSTERS = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const yaml_1 = __importDefault(require("yaml"));
|
|
@@ -12,7 +12,6 @@ const configs_1 = require("../../../util/configs");
|
|
|
12
12
|
exports.CLUSTERS = ['all', 'admin', 'card', 'paymentlinks', 'webhooks', 'endtoend', 'java', 'toolbox'];
|
|
13
13
|
exports.CUSTOM_CLUSTERS_PATH = node_path_1.default.join((0, configs_1.ensureConfigDirectory)('local'), 'custom-clusters.yaml');
|
|
14
14
|
exports.CUSTOM_CLUSTERS = loadCustomClusterConfig(exports.CUSTOM_CLUSTERS_PATH);
|
|
15
|
-
exports.CUSTOM_CLUSTER_NAMES = exports.CUSTOM_CLUSTERS.clusters.map(cluster => cluster.name);
|
|
16
15
|
// This is the complete cluster configuration that will be used as the context for template rendering
|
|
17
16
|
class PayLocalCluster {
|
|
18
17
|
name;
|
|
@@ -139,11 +138,14 @@ exports.loadServicesConfig = loadServicesConfig;
|
|
|
139
138
|
function loadCustomClusterConfig(customClusterPath) {
|
|
140
139
|
try {
|
|
141
140
|
const customClusterFileContents = node_fs_1.default.readFileSync(customClusterPath, 'utf8');
|
|
142
|
-
|
|
141
|
+
const customClusters = yaml_1.default.parse(customClusterFileContents);
|
|
142
|
+
customClusters.names = customClusters.clusters.map(cluster => cluster.name);
|
|
143
|
+
return customClusters;
|
|
143
144
|
}
|
|
144
145
|
catch (e) {
|
|
145
146
|
return {
|
|
146
|
-
clusters: []
|
|
147
|
+
clusters: [],
|
|
148
|
+
names: []
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -154,7 +156,7 @@ function includeAppInCluster(cluster, options, serviceConfig) {
|
|
|
154
156
|
return true;
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
|
-
else if (exports.
|
|
159
|
+
else if (exports.CUSTOM_CLUSTERS.names.includes(cluster)) {
|
|
158
160
|
const customCluster = exports.CUSTOM_CLUSTERS.clusters.filter(c => c.name === cluster)[0];
|
|
159
161
|
if (customCluster.apps.includes(serviceConfig.name)) {
|
|
160
162
|
return true;
|
|
@@ -22,7 +22,7 @@ const builder = (yargs) => {
|
|
|
22
22
|
.usage(`$0 local up | launch [--cluster <cluster>] [--local <app>] [--proxy] [--apps] [--rebuild] [--with-egress-proxy]\n\n${exports.desc}\n\nSpecify a list of apps that should use your locally checked out code using --local`)
|
|
23
23
|
.option('cluster', {
|
|
24
24
|
type: 'string',
|
|
25
|
-
choices: [].concat(pay_local_cluster_js_1.CLUSTERS, pay_local_cluster_js_1.
|
|
25
|
+
choices: [].concat(pay_local_cluster_js_1.CLUSTERS, pay_local_cluster_js_1.CUSTOM_CLUSTERS.names),
|
|
26
26
|
default: 'all',
|
|
27
27
|
description: 'Cluster of services to launch'
|
|
28
28
|
})
|
|
@@ -71,7 +71,8 @@ exports.builder = builder;
|
|
|
71
71
|
exports.handler = upCommandHandler;
|
|
72
72
|
async function upCommandHandler(argv) {
|
|
73
73
|
await (0, standardContent_1.showHeader)();
|
|
74
|
-
const
|
|
74
|
+
const customClusterOptions = pay_local_cluster_js_1.CUSTOM_CLUSTERS.names.includes(argv.cluster) ? pay_local_cluster_js_1.CUSTOM_CLUSTERS.clusters.filter(c => c.name === argv.cluster)[0].options : {};
|
|
75
|
+
const upOptions = Object.assign({
|
|
75
76
|
cluster: argv.cluster,
|
|
76
77
|
proxy: argv.proxy,
|
|
77
78
|
withEgressProxy: argv.withEgressProxy,
|
|
@@ -81,7 +82,7 @@ async function upCommandHandler(argv) {
|
|
|
81
82
|
pull: argv.pull,
|
|
82
83
|
mountLocalNodeApps: argv.mountLocalNodeApps,
|
|
83
84
|
mountPayJSCommons: argv.mountPayJsCommons
|
|
84
|
-
};
|
|
85
|
+
}, customClusterOptions);
|
|
85
86
|
await UpHandler(upOptions, false);
|
|
86
87
|
}
|
|
87
88
|
exports.upCommandHandler = upCommandHandler;
|