@hiiretail/gcp-infra-generators 1.0.0 → 1.0.2
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/dist/generators/clan-resources/clan-project/index.js +89 -189
- package/dist/generators/common-resources/bigquery/index.js +172 -267
- package/dist/generators/common-resources/budget/index.js +67 -153
- package/dist/generators/common-resources/cloud-armor/index.js +17 -167
- package/dist/generators/common-resources/cloud-storage/index.js +96 -205
- package/dist/generators/common-resources/cloudsql/index.js +71 -177
- package/dist/generators/common-resources/cloudsql-database/index.js +40 -287
- package/dist/generators/common-resources/confluent-cluster/index.js +23 -132
- package/dist/generators/common-resources/datastore/index.js +48 -194
- package/dist/generators/common-resources/elastic-cloud/index.js +22 -132
- package/dist/generators/common-resources/elastic-index-policy/handle-yaml.js +76 -0
- package/dist/generators/common-resources/elastic-index-policy/index.js +131 -286
- package/dist/generators/common-resources/elastic-template/index.js +52 -162
- package/dist/generators/common-resources/firestore/index.js +93 -233
- package/dist/generators/common-resources/iam/index.js +35 -157
- package/dist/generators/common-resources/iam/valid-prefix.js +8 -0
- package/dist/generators/common-resources/kafka-connect/index.js +35 -144
- package/dist/generators/common-resources/kafka-topics/index.js +20 -129
- package/dist/generators/common-resources/kms/index.js +31 -141
- package/dist/generators/common-resources/memorystore/index.js +42 -328
- package/dist/generators/common-resources/monitoring/handle-yaml.js +49 -0
- package/dist/generators/common-resources/monitoring/index.js +144 -322
- package/dist/generators/common-resources/monitoring/templates/alerts/generic-infra.yaml +37 -2
- package/dist/generators/common-resources/monitoring/validate.js +58 -0
- package/dist/generators/common-resources/pubsub/append.js +130 -0
- package/dist/generators/common-resources/pubsub/get-gcp-projects.js +34 -0
- package/dist/generators/common-resources/pubsub/handle-subscribers.js +68 -0
- package/dist/generators/common-resources/pubsub/index.js +194 -536
- package/dist/generators/common-resources/pubsub/validate.js +53 -0
- package/dist/generators/common-resources/scheduler/append.js +85 -0
- package/dist/generators/common-resources/scheduler/index.js +62 -249
- package/dist/generators/common-resources/spanner/append.js +31 -0
- package/dist/generators/common-resources/spanner/index.js +102 -269
- package/dist/generators/common-resources/spanner/validate.js +38 -0
- package/dist/generators/docs/rca/index.js +25 -135
- package/dist/generators/docs/runbook/index.js +16 -126
- package/dist/generators/docs/srb/index.js +33 -147
- package/dist/generators/docs/srb/run-docker.js +2 -0
- package/dist/generators/init/clan-infra/gcp-projects.js +47 -0
- package/dist/generators/init/clan-infra/index.js +95 -290
- package/dist/generators/init/clan-infra/tribe-clan-repo.js +38 -0
- package/dist/generators/init/clan-infra/validate.js +8 -0
- package/dist/generators/maintenance/manage-states/index.js +142 -219
- package/dist/generators/maintenance/update-modules/index.js +56 -155
- package/dist/generators/organization/clan-project/googlecloud.js +124 -0
- package/dist/generators/organization/clan-project/index.js +81 -303
- package/dist/node_modules/.package-lock.json +88 -31
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/bucket.js +5 -5
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/file.d.ts +1 -0
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/file.js +10 -1
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/storage.js +1 -1
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/transfer-manager.d.ts +4 -4
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/transfer-manager.js +4 -4
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/util.d.ts +1 -1
- package/dist/node_modules/@google-cloud/storage/build/cjs/src/util.js +2 -2
- package/dist/node_modules/@google-cloud/storage/build/esm/src/bucket.js +5 -5
- package/dist/node_modules/@google-cloud/storage/build/esm/src/file.d.ts +1 -0
- package/dist/node_modules/@google-cloud/storage/build/esm/src/file.js +10 -1
- package/dist/node_modules/@google-cloud/storage/build/esm/src/storage.js +1 -1
- package/dist/node_modules/@google-cloud/storage/build/esm/src/transfer-manager.d.ts +4 -4
- package/dist/node_modules/@google-cloud/storage/build/esm/src/transfer-manager.js +4 -4
- package/dist/node_modules/@google-cloud/storage/build/esm/src/util.d.ts +1 -1
- package/dist/node_modules/@google-cloud/storage/build/esm/src/util.js +2 -2
- package/dist/node_modules/@google-cloud/storage/package.json +5 -5
- package/dist/package.json +45 -0
- package/dist/src/BaseGenerator.js +84 -0
- package/dist/src/SecretsGenerator.js +137 -0
- package/dist/src/cli.js +54 -255
- package/dist/src/dependency-check.js +48 -0
- package/dist/src/update-check.js +38 -0
- package/dist/src/validators.js +33 -0
- package/dist/src/yeoman.js +80 -0
- package/package.json +2 -3
- package/dist/node_modules/@google-cloud/storage/CHANGELOG.md +0 -1769
|
@@ -1,368 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// src/validators.js
|
|
9
|
-
var require_validators = __commonJS({
|
|
10
|
-
"src/validators.js"(exports2, module2) {
|
|
11
|
-
var path2 = require("path");
|
|
12
|
-
module2.exports = {
|
|
13
|
-
chain: /* @__PURE__ */ __name((input, ...validators) => {
|
|
14
|
-
let msg = "";
|
|
15
|
-
validators.every((validator) => {
|
|
16
|
-
msg = validator(input);
|
|
17
|
-
return msg === true;
|
|
18
|
-
});
|
|
19
|
-
return msg === true ? true : msg;
|
|
20
|
-
}, "chain"),
|
|
21
|
-
filename: /* @__PURE__ */ __name((input) => {
|
|
22
|
-
if (!input) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
return path2.basename(input) === input ? true : "Invalid filename";
|
|
26
|
-
}, "filename"),
|
|
27
|
-
maxLength: /* @__PURE__ */ __name((input, maxLength2) => !input || input.length <= maxLength2 ? true : `Exceeds ma\
|
|
28
|
-
x length: ${maxLength2}`, "maxLength"),
|
|
29
|
-
required: /* @__PURE__ */ __name((input) => {
|
|
30
|
-
const msg = "Required";
|
|
31
|
-
if (Array.isArray(input)) {
|
|
32
|
-
return input.length > 0 ? true : msg;
|
|
33
|
-
}
|
|
34
|
-
if (input) {
|
|
35
|
-
return input.trim().length > 0 ? true : msg;
|
|
36
|
-
}
|
|
37
|
-
return msg;
|
|
38
|
-
}, "required")
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// src/BaseGenerator.js
|
|
44
|
-
var require_BaseGenerator = __commonJS({
|
|
45
|
-
"src/BaseGenerator.js"(exports2, module2) {
|
|
46
|
-
var Generator = require("yeoman-generator");
|
|
47
|
-
var path2 = require("path");
|
|
48
|
-
var fs = require("fs");
|
|
49
|
-
var inquirer = require("inquirer");
|
|
50
|
-
var { chain: chain2, required: required2, filename: filename2 } = require_validators();
|
|
51
|
-
module2.exports = class extends Generator {
|
|
52
|
-
constructor(args, opts) {
|
|
53
|
-
super(args, opts);
|
|
54
|
-
this.baseDir = path2.resolve(path2.join(__dirname, ".."));
|
|
55
|
-
this.destinationRoot(process.cwd());
|
|
56
|
-
const [command, generator] = opts.namespace.split(":").slice(-2);
|
|
57
|
-
this.generatorId = path2.join(command, generator);
|
|
58
|
-
this.sourceRoot(
|
|
59
|
-
path2.join(this.baseDir, "generators", this.generatorId, "templates")
|
|
60
|
-
);
|
|
61
|
-
this.copyDir = (templateDir, targetDir, answers = this.answers, skipIfExists = false) => {
|
|
62
|
-
if (skipIfExists && fs.existsSync(targetDir)) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
this.fs.copyTpl(
|
|
66
|
-
this.templatePath(`${templateDir}/**/*`),
|
|
67
|
-
this.destinationPath(targetDir),
|
|
68
|
-
answers
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
this.listSubDirectories = (parent) => fs.readdirSync(parent).filter((f) => !f.startsWith(".")).filter((f) => fs.
|
|
72
|
-
lstatSync(path2.join(parent, f)).isDirectory()).sort((a, b) => a.localeCompare(b));
|
|
73
|
-
this.kebabCase = (input) => input.replace(/\s|_/g, "-");
|
|
74
|
-
this.chooseOrCreatePrompts = (name, getChoicesDirectory) => [
|
|
75
|
-
{
|
|
76
|
-
when: /* @__PURE__ */ __name((answers) => fs.existsSync(getChoicesDirectory(answers)), "when"),
|
|
77
|
-
type: "list",
|
|
78
|
-
name,
|
|
79
|
-
message: `Choose ${name}`,
|
|
80
|
-
store: true,
|
|
81
|
-
choices: /* @__PURE__ */ __name((answers) => [
|
|
82
|
-
...this.listSubDirectories(getChoicesDirectory(answers)),
|
|
83
|
-
new inquirer.Separator(),
|
|
84
|
-
`Create new ${name}`
|
|
85
|
-
], "choices"),
|
|
86
|
-
validate: required2,
|
|
87
|
-
filter: this.kebabCase
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
when: /* @__PURE__ */ __name((answers) => !fs.existsSync(getChoicesDirectory(answers)) || answers[name] === `\
|
|
91
|
-
Create-new-${name}`, "when"),
|
|
92
|
-
type: "input",
|
|
93
|
-
name: `new-${name}`,
|
|
94
|
-
message: `New ${name} name`,
|
|
95
|
-
store: false,
|
|
96
|
-
validate: /* @__PURE__ */ __name((input) => chain2(input, required2, filename2), "validate"),
|
|
97
|
-
filter: this.kebabCase
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
when: /* @__PURE__ */ __name((answers) => !fs.existsSync(getChoicesDirectory(answers)) || answers[name] === "\
|
|
101
|
-
Create-new-tribe", "when"),
|
|
102
|
-
type: "input",
|
|
103
|
-
name: "costCenter",
|
|
104
|
-
message: "Please provide the Cost Center of the Tribe",
|
|
105
|
-
store: false,
|
|
106
|
-
validate: /* @__PURE__ */ __name((input) => chain2(input, required2, filename2), "validate"),
|
|
107
|
-
filter: this.kebabCase
|
|
108
|
-
}
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// generators/organization/clan-project/googlecloud.js
|
|
116
|
-
var require_googlecloud = __commonJS({
|
|
117
|
-
"generators/organization/clan-project/googlecloud.js"(exports2, module2) {
|
|
118
|
-
var availableApis = [
|
|
119
|
-
{
|
|
120
|
-
value: "automl.googleapis.com",
|
|
121
|
-
name: "Cloud AutoML API"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
value: "bigtable.googleapis.com",
|
|
125
|
-
name: "Cloud Bigtable"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
value: "bigquery.googleapis.com",
|
|
129
|
-
name: "Cloud BigQuery"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
value: "cloudapis.googleapis.com",
|
|
133
|
-
name: "Google Cloud APIs",
|
|
134
|
-
enabled: true
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
value: "clouddeploy.googleapis.com",
|
|
138
|
-
name: "Cloud Deploy API",
|
|
139
|
-
enabled: true
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
value: "cloudfunctions.googleapis.com",
|
|
143
|
-
name: "Cloud Functions API"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
value: "cloudresourcemanager.googleapis.com",
|
|
147
|
-
name: "Cloud Resource Manager API",
|
|
148
|
-
enabled: true
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
value: "compute.googleapis.com",
|
|
152
|
-
name: "Compute Engine API"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
value: "container.googleapis.com",
|
|
156
|
-
name: "Kubernetes",
|
|
157
|
-
enabled: true
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
value: "containerregistry.googleapis.com",
|
|
161
|
-
name: "Container Registry",
|
|
162
|
-
enabled: true
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
value: "dataflow.googleapis.com",
|
|
166
|
-
name: "Dataflow API"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
value: "dns.googleapis.com",
|
|
170
|
-
name: "Cloud DNS API",
|
|
171
|
-
enabled: true
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
value: "firestore.googleapis.com",
|
|
175
|
-
name: "Cloud Firestore"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
value: "monitoring.googleapis.com",
|
|
179
|
-
name: "Stackdriver Monitoring API",
|
|
180
|
-
enabled: true
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
value: "pubsub.googleapis.com",
|
|
184
|
-
name: "Cloud Pub/Sub API"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
value: "redis.googleapis.com",
|
|
188
|
-
name: "Memorystore (Redis)"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
value: "run.googleapis.com",
|
|
192
|
-
name: "Cloud Run API",
|
|
193
|
-
enabled: true
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
value: "secretmanager.googleapis.com",
|
|
197
|
-
name: "Secret Manager API",
|
|
198
|
-
enabled: true
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
value: "spanner.googleapis.com",
|
|
202
|
-
name: "Cloud Spanner API"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
value: "storage-api.googleapis.com",
|
|
206
|
-
name: "Cloud Storage"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
value: "sqladmin.googleapis.com",
|
|
210
|
-
name: "Cloud SQL"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
value: "servicenetworking.googleapis.com",
|
|
214
|
-
name: "Service Networking API",
|
|
215
|
-
enabled: true
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
value: "vpcaccess.googleapis.com",
|
|
219
|
-
name: "Serverless VPC Access API",
|
|
220
|
-
enabled: true
|
|
221
|
-
}
|
|
222
|
-
];
|
|
223
|
-
var apisYaml = /* @__PURE__ */ __name((resources = []) => availableApis.map((entry) => ({
|
|
224
|
-
...entry,
|
|
225
|
-
enabled: entry.enabled || resources.includes(entry.value)
|
|
226
|
-
})).reduce(
|
|
227
|
-
(acc, entry) => `${acc}${entry.enabled ? " -" : "# -"} ${entry.value.padEnd(60, " ")} # ${entry.name}
|
|
228
|
-
`,
|
|
229
|
-
""
|
|
230
|
-
).trimEnd(), "apisYaml");
|
|
231
|
-
module2.exports = {
|
|
232
|
-
apisYaml
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
// generators/organization/clan-project/index.js
|
|
238
|
-
var path = require("path");
|
|
239
|
-
var chalk = require("chalk");
|
|
240
|
-
var BaseGenerator = require_BaseGenerator();
|
|
241
|
-
var {
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const chalk = require('chalk');
|
|
3
|
+
const BaseGenerator = require('../../../src/BaseGenerator');
|
|
4
|
+
const {
|
|
242
5
|
chain,
|
|
243
6
|
required,
|
|
244
7
|
filename,
|
|
245
|
-
maxLength
|
|
246
|
-
} =
|
|
247
|
-
|
|
248
|
-
|
|
8
|
+
maxLength,
|
|
9
|
+
} = require('../../../src/validators');
|
|
10
|
+
const googleapis = require('./googlecloud');
|
|
11
|
+
|
|
12
|
+
const resolveAnswer = (answers, name) =>
|
|
13
|
+
answers[`new-${name}`] || answers[name];
|
|
14
|
+
|
|
249
15
|
module.exports = class extends BaseGenerator {
|
|
250
16
|
constructor(args, opts) {
|
|
251
17
|
super(args, opts);
|
|
252
|
-
|
|
18
|
+
|
|
19
|
+
// Output directory relative to the tf-infra-gcp directory.
|
|
20
|
+
this.destinationRoot('organization');
|
|
253
21
|
}
|
|
22
|
+
|
|
254
23
|
prompting() {
|
|
255
24
|
const prompts = [
|
|
256
25
|
{
|
|
257
|
-
type:
|
|
258
|
-
name:
|
|
259
|
-
default:
|
|
260
|
-
message:
|
|
26
|
+
type: 'list',
|
|
27
|
+
name: 'domain',
|
|
28
|
+
default: 'extendaretail-com',
|
|
29
|
+
message: 'Choose GCP Organization',
|
|
261
30
|
store: true,
|
|
262
31
|
choices: this.listSubDirectories(this.destinationPath()),
|
|
263
|
-
validate: required
|
|
32
|
+
validate: required,
|
|
264
33
|
},
|
|
265
|
-
...this.chooseOrCreatePrompts(
|
|
266
|
-
|
|
267
|
-
(answers) => path.join(this.destinationPath(), answers.domain, "departments")
|
|
34
|
+
...this.chooseOrCreatePrompts('department', (answers) =>
|
|
35
|
+
path.join(this.destinationPath(), answers.domain, 'departments'),
|
|
268
36
|
),
|
|
269
|
-
...this.chooseOrCreatePrompts(
|
|
270
|
-
|
|
271
|
-
(answers) => path.join(
|
|
37
|
+
...this.chooseOrCreatePrompts('tribe', (answers) =>
|
|
38
|
+
path.join(
|
|
272
39
|
this.destinationPath(),
|
|
273
40
|
answers.domain,
|
|
274
|
-
|
|
275
|
-
resolveAnswer(answers,
|
|
276
|
-
)
|
|
41
|
+
'departments',
|
|
42
|
+
resolveAnswer(answers, 'department'),
|
|
43
|
+
),
|
|
277
44
|
),
|
|
278
45
|
{
|
|
279
|
-
type:
|
|
280
|
-
name:
|
|
281
|
-
message:
|
|
46
|
+
type: 'input',
|
|
47
|
+
name: 'clan',
|
|
48
|
+
message: 'Clan name',
|
|
282
49
|
store: false,
|
|
283
50
|
// Max project name length is 30. But we must account for -staging-RAND suffix
|
|
284
|
-
validate:
|
|
285
|
-
|
|
51
|
+
validate: (input) =>
|
|
52
|
+
chain(input, required, filename, (s) => maxLength(s, 17)),
|
|
53
|
+
filter: this.kebabCase,
|
|
286
54
|
},
|
|
287
55
|
{
|
|
288
|
-
type:
|
|
289
|
-
name:
|
|
290
|
-
message:
|
|
291
|
-
default:
|
|
56
|
+
type: 'input',
|
|
57
|
+
name: 'commonInfraRepo',
|
|
58
|
+
message: 'Name of GitHub repository for clan common infrastructure',
|
|
59
|
+
default: (answers) => `${answers.tribe}-${answers.clan}-common`,
|
|
292
60
|
},
|
|
293
61
|
{
|
|
294
|
-
type:
|
|
295
|
-
name:
|
|
296
|
-
message:
|
|
297
|
-
validate: required
|
|
298
|
-
}
|
|
62
|
+
type: 'input',
|
|
63
|
+
name: 'costCenter',
|
|
64
|
+
message: 'Please provide the Cost Center of the Clan',
|
|
65
|
+
validate: required,
|
|
66
|
+
},
|
|
299
67
|
];
|
|
68
|
+
|
|
300
69
|
return this.prompt(prompts).then((props) => {
|
|
301
70
|
this.answers = {
|
|
302
71
|
...props,
|
|
303
|
-
department: resolveAnswer(props,
|
|
304
|
-
tribe: resolveAnswer(props,
|
|
72
|
+
department: resolveAnswer(props, 'department'),
|
|
73
|
+
tribe: resolveAnswer(props, 'tribe'),
|
|
305
74
|
};
|
|
306
75
|
});
|
|
307
76
|
}
|
|
77
|
+
|
|
308
78
|
writing() {
|
|
309
79
|
const { domain, department, tribe, clan } = this.answers;
|
|
80
|
+
|
|
81
|
+
// Department
|
|
310
82
|
this.copyDir(
|
|
311
|
-
|
|
312
|
-
path.join(domain,
|
|
83
|
+
'department',
|
|
84
|
+
path.join(domain, 'departments', department),
|
|
313
85
|
this.answers,
|
|
314
|
-
true
|
|
86
|
+
true,
|
|
315
87
|
);
|
|
88
|
+
|
|
89
|
+
// Tribe
|
|
316
90
|
this.copyDir(
|
|
317
|
-
|
|
318
|
-
path.join(domain,
|
|
91
|
+
'tribe',
|
|
92
|
+
path.join(domain, 'departments', department, tribe),
|
|
319
93
|
this.answers,
|
|
320
|
-
true
|
|
94
|
+
true,
|
|
321
95
|
);
|
|
96
|
+
|
|
97
|
+
// Clan
|
|
322
98
|
this.copyDir(
|
|
323
|
-
|
|
324
|
-
path.join(domain,
|
|
99
|
+
'clans-folder',
|
|
100
|
+
path.join(domain, 'departments', department, tribe, 'clans'),
|
|
325
101
|
this.answers,
|
|
326
|
-
true
|
|
102
|
+
true,
|
|
327
103
|
);
|
|
328
104
|
const clanDir = path.join(
|
|
329
105
|
domain,
|
|
330
|
-
|
|
106
|
+
'departments',
|
|
331
107
|
department,
|
|
332
108
|
tribe,
|
|
333
|
-
|
|
334
|
-
clan
|
|
109
|
+
'clans',
|
|
110
|
+
clan,
|
|
335
111
|
);
|
|
336
|
-
this.copyDir(
|
|
337
|
-
|
|
338
|
-
|
|
112
|
+
this.copyDir('clan', clanDir, this.answers, true);
|
|
113
|
+
|
|
114
|
+
// Clan GCP projects
|
|
115
|
+
['staging', 'prod'].forEach((env) => {
|
|
116
|
+
this.copyDir('clan-project', path.join(clanDir, env), {
|
|
339
117
|
...this.answers,
|
|
340
118
|
activate_apis: googleapis.apisYaml([]),
|
|
341
119
|
env,
|
|
342
120
|
clan,
|
|
343
|
-
tribe
|
|
121
|
+
tribe,
|
|
344
122
|
});
|
|
345
123
|
});
|
|
346
124
|
}
|
|
125
|
+
|
|
347
126
|
end() {
|
|
348
127
|
const { domain, department, tribe, clan } = this.answers;
|
|
349
128
|
const clanDir = path.join(
|
|
350
129
|
domain,
|
|
351
|
-
|
|
130
|
+
'departments',
|
|
352
131
|
department,
|
|
353
132
|
tribe,
|
|
354
|
-
|
|
355
|
-
clan
|
|
133
|
+
'clans',
|
|
134
|
+
clan,
|
|
356
135
|
);
|
|
357
136
|
this.log(`
|
|
358
|
-
${chalk.green(
|
|
359
|
-
|
|
360
|
-
${chalk.
|
|
361
|
-
|
|
362
|
-
${chalk.
|
|
363
|
-
\u2192 ${chalk.cyan(path.join(clanDir,
|
|
364
|
-
|
|
365
|
-
${chalk.green("3.")} Push this change in a feature branch and open a pull request.
|
|
137
|
+
${chalk.green('Your clan projects have now been created. To finalize your configuration, please continue with manual editing of the generated files.')}
|
|
138
|
+
${chalk.green('1.')} Add clan members and groups
|
|
139
|
+
\u2192 ${chalk.cyan(path.join(clanDir, 'clan.yaml'))}
|
|
140
|
+
${chalk.green('2.')} Configure APIs, service accounts and repositories
|
|
141
|
+
\u2192 ${chalk.cyan(path.join(clanDir, 'prod', 'project.yaml'))}
|
|
142
|
+
\u2192 ${chalk.cyan(path.join(clanDir, 'staging', 'project.yaml'))}
|
|
143
|
+
${chalk.green('3.')} Push this change in a feature branch and open a pull request.
|
|
366
144
|
`);
|
|
367
145
|
}
|
|
368
146
|
};
|
|
@@ -562,6 +562,23 @@
|
|
|
562
562
|
"dev": true,
|
|
563
563
|
"license": "MIT"
|
|
564
564
|
},
|
|
565
|
+
"node_modules/@esbuild/linux-x64": {
|
|
566
|
+
"version": "0.25.9",
|
|
567
|
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz",
|
|
568
|
+
"integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==",
|
|
569
|
+
"cpu": [
|
|
570
|
+
"x64"
|
|
571
|
+
],
|
|
572
|
+
"dev": true,
|
|
573
|
+
"license": "MIT",
|
|
574
|
+
"optional": true,
|
|
575
|
+
"os": [
|
|
576
|
+
"linux"
|
|
577
|
+
],
|
|
578
|
+
"engines": {
|
|
579
|
+
"node": ">=18"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
565
582
|
"node_modules/@eslint-community/eslint-utils": {
|
|
566
583
|
"version": "4.7.0",
|
|
567
584
|
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
|
|
@@ -620,9 +637,9 @@
|
|
|
620
637
|
}
|
|
621
638
|
},
|
|
622
639
|
"node_modules/@eslint/config-helpers": {
|
|
623
|
-
"version": "0.3.
|
|
624
|
-
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.
|
|
625
|
-
"integrity": "sha512-
|
|
640
|
+
"version": "0.3.1",
|
|
641
|
+
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz",
|
|
642
|
+
"integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==",
|
|
626
643
|
"dev": true,
|
|
627
644
|
"license": "Apache-2.0",
|
|
628
645
|
"engines": {
|
|
@@ -630,9 +647,9 @@
|
|
|
630
647
|
}
|
|
631
648
|
},
|
|
632
649
|
"node_modules/@eslint/core": {
|
|
633
|
-
"version": "0.15.
|
|
634
|
-
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.
|
|
635
|
-
"integrity": "sha512-
|
|
650
|
+
"version": "0.15.2",
|
|
651
|
+
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz",
|
|
652
|
+
"integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==",
|
|
636
653
|
"dev": true,
|
|
637
654
|
"license": "Apache-2.0",
|
|
638
655
|
"dependencies": {
|
|
@@ -690,9 +707,9 @@
|
|
|
690
707
|
}
|
|
691
708
|
},
|
|
692
709
|
"node_modules/@eslint/js": {
|
|
693
|
-
"version": "9.
|
|
694
|
-
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.
|
|
695
|
-
"integrity": "sha512-
|
|
710
|
+
"version": "9.33.0",
|
|
711
|
+
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz",
|
|
712
|
+
"integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==",
|
|
696
713
|
"dev": true,
|
|
697
714
|
"license": "MIT",
|
|
698
715
|
"engines": {
|
|
@@ -713,13 +730,13 @@
|
|
|
713
730
|
}
|
|
714
731
|
},
|
|
715
732
|
"node_modules/@eslint/plugin-kit": {
|
|
716
|
-
"version": "0.3.
|
|
717
|
-
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.
|
|
718
|
-
"integrity": "sha512-
|
|
733
|
+
"version": "0.3.5",
|
|
734
|
+
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz",
|
|
735
|
+
"integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==",
|
|
719
736
|
"dev": true,
|
|
720
737
|
"license": "Apache-2.0",
|
|
721
738
|
"dependencies": {
|
|
722
|
-
"@eslint/core": "^0.15.
|
|
739
|
+
"@eslint/core": "^0.15.2",
|
|
723
740
|
"levn": "^0.4.1"
|
|
724
741
|
},
|
|
725
742
|
"engines": {
|
|
@@ -758,10 +775,9 @@
|
|
|
758
775
|
}
|
|
759
776
|
},
|
|
760
777
|
"node_modules/@google-cloud/storage": {
|
|
761
|
-
"version": "7.
|
|
762
|
-
"resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.
|
|
763
|
-
"integrity": "sha512-
|
|
764
|
-
"license": "Apache-2.0",
|
|
778
|
+
"version": "7.17.0",
|
|
779
|
+
"resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.17.0.tgz",
|
|
780
|
+
"integrity": "sha512-5m9GoZqKh52a1UqkxDBu/+WVFDALNtHg5up5gNmNbXQWBcV813tzJKsyDtKjOPrlR1em1TxtD7NSPCrObH7koQ==",
|
|
765
781
|
"dependencies": {
|
|
766
782
|
"@google-cloud/paginator": "^5.0.0",
|
|
767
783
|
"@google-cloud/projectify": "^4.0.0",
|
|
@@ -3876,6 +3892,48 @@
|
|
|
3876
3892
|
"url": "https://github.com/sponsors/ljharb"
|
|
3877
3893
|
}
|
|
3878
3894
|
},
|
|
3895
|
+
"node_modules/esbuild": {
|
|
3896
|
+
"version": "0.25.9",
|
|
3897
|
+
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz",
|
|
3898
|
+
"integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==",
|
|
3899
|
+
"dev": true,
|
|
3900
|
+
"hasInstallScript": true,
|
|
3901
|
+
"license": "MIT",
|
|
3902
|
+
"bin": {
|
|
3903
|
+
"esbuild": "bin/esbuild"
|
|
3904
|
+
},
|
|
3905
|
+
"engines": {
|
|
3906
|
+
"node": ">=18"
|
|
3907
|
+
},
|
|
3908
|
+
"optionalDependencies": {
|
|
3909
|
+
"@esbuild/aix-ppc64": "0.25.9",
|
|
3910
|
+
"@esbuild/android-arm": "0.25.9",
|
|
3911
|
+
"@esbuild/android-arm64": "0.25.9",
|
|
3912
|
+
"@esbuild/android-x64": "0.25.9",
|
|
3913
|
+
"@esbuild/darwin-arm64": "0.25.9",
|
|
3914
|
+
"@esbuild/darwin-x64": "0.25.9",
|
|
3915
|
+
"@esbuild/freebsd-arm64": "0.25.9",
|
|
3916
|
+
"@esbuild/freebsd-x64": "0.25.9",
|
|
3917
|
+
"@esbuild/linux-arm": "0.25.9",
|
|
3918
|
+
"@esbuild/linux-arm64": "0.25.9",
|
|
3919
|
+
"@esbuild/linux-ia32": "0.25.9",
|
|
3920
|
+
"@esbuild/linux-loong64": "0.25.9",
|
|
3921
|
+
"@esbuild/linux-mips64el": "0.25.9",
|
|
3922
|
+
"@esbuild/linux-ppc64": "0.25.9",
|
|
3923
|
+
"@esbuild/linux-riscv64": "0.25.9",
|
|
3924
|
+
"@esbuild/linux-s390x": "0.25.9",
|
|
3925
|
+
"@esbuild/linux-x64": "0.25.9",
|
|
3926
|
+
"@esbuild/netbsd-arm64": "0.25.9",
|
|
3927
|
+
"@esbuild/netbsd-x64": "0.25.9",
|
|
3928
|
+
"@esbuild/openbsd-arm64": "0.25.9",
|
|
3929
|
+
"@esbuild/openbsd-x64": "0.25.9",
|
|
3930
|
+
"@esbuild/openharmony-arm64": "0.25.9",
|
|
3931
|
+
"@esbuild/sunos-x64": "0.25.9",
|
|
3932
|
+
"@esbuild/win32-arm64": "0.25.9",
|
|
3933
|
+
"@esbuild/win32-ia32": "0.25.9",
|
|
3934
|
+
"@esbuild/win32-x64": "0.25.9"
|
|
3935
|
+
}
|
|
3936
|
+
},
|
|
3879
3937
|
"node_modules/escalade": {
|
|
3880
3938
|
"version": "3.2.0",
|
|
3881
3939
|
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
|
|
@@ -3895,20 +3953,20 @@
|
|
|
3895
3953
|
}
|
|
3896
3954
|
},
|
|
3897
3955
|
"node_modules/eslint": {
|
|
3898
|
-
"version": "9.
|
|
3899
|
-
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.
|
|
3900
|
-
"integrity": "sha512-
|
|
3956
|
+
"version": "9.33.0",
|
|
3957
|
+
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.33.0.tgz",
|
|
3958
|
+
"integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==",
|
|
3901
3959
|
"dev": true,
|
|
3902
3960
|
"license": "MIT",
|
|
3903
3961
|
"dependencies": {
|
|
3904
3962
|
"@eslint-community/eslint-utils": "^4.2.0",
|
|
3905
3963
|
"@eslint-community/regexpp": "^4.12.1",
|
|
3906
3964
|
"@eslint/config-array": "^0.21.0",
|
|
3907
|
-
"@eslint/config-helpers": "^0.3.
|
|
3908
|
-
"@eslint/core": "^0.15.
|
|
3965
|
+
"@eslint/config-helpers": "^0.3.1",
|
|
3966
|
+
"@eslint/core": "^0.15.2",
|
|
3909
3967
|
"@eslint/eslintrc": "^3.3.1",
|
|
3910
|
-
"@eslint/js": "9.
|
|
3911
|
-
"@eslint/plugin-kit": "^0.3.
|
|
3968
|
+
"@eslint/js": "9.33.0",
|
|
3969
|
+
"@eslint/plugin-kit": "^0.3.5",
|
|
3912
3970
|
"@humanfs/node": "^0.16.6",
|
|
3913
3971
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
3914
3972
|
"@humanwhocodes/retry": "^0.4.2",
|
|
@@ -8226,9 +8284,9 @@
|
|
|
8226
8284
|
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
|
8227
8285
|
},
|
|
8228
8286
|
"node_modules/nock": {
|
|
8229
|
-
"version": "14.0.
|
|
8230
|
-
"resolved": "https://registry.npmjs.org/nock/-/nock-14.0.
|
|
8231
|
-
"integrity": "sha512-
|
|
8287
|
+
"version": "14.0.10",
|
|
8288
|
+
"resolved": "https://registry.npmjs.org/nock/-/nock-14.0.10.tgz",
|
|
8289
|
+
"integrity": "sha512-Q7HjkpyPeLa0ZVZC5qpxBt5EyLczFJ91MEewQiIi9taWuA0KB/MDJlUWtON+7dGouVdADTQsf9RA7TZk6D8VMw==",
|
|
8232
8290
|
"dev": true,
|
|
8233
8291
|
"license": "MIT",
|
|
8234
8292
|
"dependencies": {
|
|
@@ -11472,7 +11530,7 @@
|
|
|
11472
11530
|
},
|
|
11473
11531
|
"packages/gcp-infra": {
|
|
11474
11532
|
"name": "@hiiretail/gcp-infra-cli",
|
|
11475
|
-
"version": "
|
|
11533
|
+
"version": "0.0.1-local",
|
|
11476
11534
|
"license": "MIT",
|
|
11477
11535
|
"dependencies": {
|
|
11478
11536
|
"semver": "^7.7.2",
|
|
@@ -11484,10 +11542,10 @@
|
|
|
11484
11542
|
},
|
|
11485
11543
|
"packages/generators": {
|
|
11486
11544
|
"name": "@hiiretail/gcp-infra-generators",
|
|
11487
|
-
"version": "1.0.
|
|
11545
|
+
"version": "1.0.2",
|
|
11488
11546
|
"license": "MIT",
|
|
11489
11547
|
"dependencies": {
|
|
11490
|
-
"@google-cloud/storage": "^7.
|
|
11548
|
+
"@google-cloud/storage": "^7.17.0",
|
|
11491
11549
|
"axios": "^1.11.0",
|
|
11492
11550
|
"chalk": "^4.1.2",
|
|
11493
11551
|
"commander": "^14.0.0",
|
|
@@ -11502,7 +11560,6 @@
|
|
|
11502
11560
|
"yeoman-generator": "^4.13.0"
|
|
11503
11561
|
},
|
|
11504
11562
|
"devDependencies": {
|
|
11505
|
-
"esbuild": "^0.25.8",
|
|
11506
11563
|
"mock-fs": "^5.5.0",
|
|
11507
11564
|
"yeoman-assert": "^3.1.1",
|
|
11508
11565
|
"yeoman-test": "^2.7.0"
|