@ibm-cloud/cd-tools 1.15.10 → 1.15.13
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/cmd/utils/import-terraform.js +15 -8
- package/package.json +4 -1
- package/renovate.json +13 -1
|
@@ -15,7 +15,7 @@ import { jsonToTf } from 'json-to-tf';
|
|
|
15
15
|
import { getPipelineData, getToolchainTools } from './requests.js';
|
|
16
16
|
import { runTerraformPlanGenerate, setTerraformEnv } from './terraform.js';
|
|
17
17
|
import { getRandChars, isSecretReference, normalizeName } from './utils.js';
|
|
18
|
-
import {
|
|
18
|
+
import { logger } from './logger.js';
|
|
19
19
|
|
|
20
20
|
import { SECRET_KEYS_MAP, SUPPORTED_TOOLS_MAP } from '../../config.js';
|
|
21
21
|
|
|
@@ -331,13 +331,20 @@ export async function importTerraform(token, apiKey, region, toolchainId, toolch
|
|
|
331
331
|
|
|
332
332
|
if (!isCompact) {
|
|
333
333
|
for (const [key, value] of Object.entries(newTfFileObj['resource'])) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
334
|
+
try {
|
|
335
|
+
if (!key.startsWith('ibm_')) continue;
|
|
336
|
+
const newFileName = key.split('ibm_')[1];
|
|
337
|
+
|
|
338
|
+
const newFileContentsJson = { 'resource': { [key]: value } };
|
|
339
|
+
const newFileContentsTf = jsonToTf(JSON.stringify(newFileContentsJson));
|
|
340
|
+
|
|
341
|
+
fs.writeFileSync(`${dir}/generated/${newFileName}.tf`, newFileContentsTf);
|
|
342
|
+
} catch (err) {
|
|
343
|
+
// some extra error logging
|
|
344
|
+
logger.dump(`\nCurrent resource: ${key}`);
|
|
345
|
+
logger.dump(`\n Current resource value: ${JSON.stringify(value, null, 2)}`);
|
|
346
|
+
throw err;
|
|
347
|
+
}
|
|
341
348
|
}
|
|
342
349
|
} else {
|
|
343
350
|
const generatedFileNew = jsonToTf(JSON.stringify(newTfFileObj));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibm-cloud/cd-tools",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.13",
|
|
4
4
|
"description": "Tools and utilities for the IBM Cloud Continuous Delivery service and resources",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,5 +38,8 @@
|
|
|
38
38
|
"mocha": "^11.7.4",
|
|
39
39
|
"nconf": "^0.13.0",
|
|
40
40
|
"node-pty": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"overrides": {
|
|
43
|
+
"serialize-javascript": "^7.0.3"
|
|
41
44
|
}
|
|
42
45
|
}
|
package/renovate.json
CHANGED
|
@@ -2,5 +2,17 @@
|
|
|
2
2
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
3
|
"extends": [
|
|
4
4
|
"config:recommended"
|
|
5
|
-
]
|
|
5
|
+
],
|
|
6
|
+
"packageRules": [
|
|
7
|
+
{
|
|
8
|
+
"enabled": false,
|
|
9
|
+
"matchPackageNames": [
|
|
10
|
+
"*"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"vulnerabilityAlerts": {
|
|
15
|
+
"enabled": true
|
|
16
|
+
},
|
|
17
|
+
"osvVulnerabilityAlerts": true
|
|
6
18
|
}
|