@ibm-cloud/cd-tools 1.3.0 → 1.3.1

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.
@@ -20,10 +20,10 @@ import { getAccountId, getBearerToken, getCdInstanceByRegion, getIamAuthPolicies
20
20
  import { validatePrereqsVersions, validateTag, validateToolchainId, validateToolchainName, validateTools, validateOAuth, warnDuplicateName, validateGritUrl } from './utils/validate.js';
21
21
  import { importTerraform } from './utils/import-terraform.js';
22
22
 
23
- import { COPY_TOOLCHAIN_DESC, MIGRATION_DOC_URL, TARGET_REGIONS, SOURCE_REGIONS } from '../config.js';
23
+ import { COPY_TOOLCHAIN_DESC, DOCS_URL, TARGET_REGIONS, SOURCE_REGIONS } from '../config.js';
24
24
 
25
25
  process.on('exit', (code) => {
26
- if (code !== 0) logger.print(`Need help? Visit ${MIGRATION_DOC_URL} for more troubleshooting information.`);
26
+ if (code !== 0) logger.print(`Need help? Visit ${DOCS_URL} for more troubleshooting information.`);
27
27
  });
28
28
 
29
29
  const TIME_SUFFIX = new Date().getTime();
@@ -45,21 +45,24 @@ const command = new Command('copy-toolchain')
45
45
  .choices(TARGET_REGIONS)
46
46
  .makeOptionMandatory()
47
47
  )
48
- .option('-a --apikey <api key>', 'API Key used to perform the copy. Must have IAM permission to read and create toolchains and S2S authorizations in source and target region / resource group')
48
+ .option('-a, --apikey <api_key>', 'API key used to authenticate. Must have IAM permission to read and create toolchains and service-to-service authorizations in source and target region / resource group')
49
49
  .option('-n, --name <name>', '(Optional) The name of the copied toolchain (default: same name as original)')
50
- .option('-g, --resource-group <resource group>', '(Optional) The name or ID of destination resource group of the copied toolchain (default: same resource group as original)')
50
+ .option('-g, --resource-group <resource_group>', '(Optional) The name or ID of destination resource group of the copied toolchain (default: same resource group as original)')
51
51
  .option('-t, --tag <tag>', '(Optional) The tag to add to the copied toolchain')
52
52
  .helpOption('-h, --help', 'Display help for command')
53
53
  .optionsGroup('Advanced options:')
54
- .option('-d, --terraform-dir <directory path>', '(Optional) The target local directory to store the generated Terraform (.tf) files')
55
- .option('-D, --dry-run', '(Optional) Skip running terraform apply')
54
+ .option('-d, --terraform-dir <path>', '(Optional) The target local directory to store the generated Terraform (.tf) files')
55
+ .option('-D, --dry-run', '(Optional) Skip running terraform apply; only generate the Terraform (.tf) files')
56
56
  .option('-f, --force', '(Optional) Force the copy toolchain command to run without user confirmation')
57
- .option('-S, --skip-s2s', '(Optional) Skip importing toolchain-generated S2S authorizations')
58
- .option('-T, --skip-disable-triggers', '(Optional) Skip disabling triggers')
59
- .option('-C, --compact', '(Optional) Generate all resources in resources.tf')
60
- .option('-v --verbose', '(Optional) Increase log output')
61
- .option('-s --silent', '(Optional) Suppress non-essential output, only errors and critical warnings are displayed')
62
- .option('-G --grit-mapping-file <path>', '(Optional) JSON file mapping GRIT project urls to project urls in the target region')
57
+ .option('-S, --skip-s2s', '(Optional) Skip importing toolchain-generated service-to-service authorizations')
58
+ .option('-T, --skip-disable-triggers', '(Optional) Skip disabling Tekton pipeline Git or timed triggers. Note: This may result in duplicate pipeline runs')
59
+ .option('-C, --compact', '(Optional) Generate all resources in a single resources.tf file')
60
+ .option('-v, --verbose', '(Optional) Increase log output')
61
+ .option('-q, --quiet', '(Optional) Suppress non-essential output, only errors and critical warnings are displayed')
62
+ .addOption(
63
+ new Option('-G, --grit-mapping-file <path>', '(Optional) JSON file mapping GRIT project urls to project urls in the target region')
64
+ .hideHelp()
65
+ )
63
66
  .showHelpAfterError()
64
67
  .hook('preAction', cmd => cmd.showHelpAfterError(false)) // only show help during validation
65
68
  .action(main);
@@ -74,7 +77,7 @@ async function main(options) {
74
77
  const includeS2S = !options.skipS2s;
75
78
  const disableTriggers = !options.skipDisableTriggers;
76
79
  const isCompact = options.compact || false;
77
- const verbosity = options.silent ? 0 : options.verbose ? 2 : 1;
80
+ const verbosity = options.quiet ? 0 : options.verbose ? 2 : 1;
78
81
 
79
82
  logger.setVerbosity(verbosity);
80
83
  if (LOG_DUMP) logger.createLogStream(`${LOGS_DIR}/copy-toolchain-${new Date().getTime()}.log`);
package/config.js CHANGED
@@ -17,9 +17,9 @@ Examples:
17
17
  Copy a toolchain to the Frankfurt region with the specified name and target resource group, using the given API key
18
18
 
19
19
  Environment Variables:
20
- IBMCLOUD_API_KEY API Key used to perform the copy. Must have IAM permission to read and create toolchains and S2S authorizations in source and target region / resource group`
20
+ IBMCLOUD_API_KEY API key used to authenticate. Must have IAM permission to read and create toolchains and service-to-service authorizations in source and target region / resource group`
21
21
 
22
- const MIGRATION_DOC_URL = 'https://github.com/IBM/continuous-delivery-tools'; // TODO: replace with docs link
22
+ const DOCS_URL = 'https://github.com/IBM/continuous-delivery-tools';
23
23
 
24
24
  const SOURCE_REGIONS = [
25
25
  'au-syd',
@@ -220,7 +220,7 @@ const VAULT_REGEX = [
220
220
 
221
221
  export {
222
222
  COPY_TOOLCHAIN_DESC,
223
- MIGRATION_DOC_URL,
223
+ DOCS_URL,
224
224
  SOURCE_REGIONS,
225
225
  TARGET_REGIONS,
226
226
  TERRAFORM_REQUIRED_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibm-cloud/cd-tools",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Tools and utilities for the IBM Cloud Continuous Delivery service and resources",
5
5
  "repository": {
6
6
  "type": "git",
@@ -119,8 +119,8 @@ describe('copy-toolchain: Test functionalities', function () {
119
119
  }
120
120
  },
121
121
  {
122
- name: 'Silent flag suppresses info, debug and log messages',
123
- cmd: [CLI_PATH, COMMAND, '-c', TEST_TOOLCHAINS['empty'].crn, '-r', TEST_TOOLCHAINS['empty'].region, '-s'],
122
+ name: 'Quiet flag suppresses info, debug and log messages',
123
+ cmd: [CLI_PATH, COMMAND, '-c', TEST_TOOLCHAINS['empty'].crn, '-r', TEST_TOOLCHAINS['empty'].region, '-q'],
124
124
  expected: null,
125
125
  options: {
126
126
  timeout: 100000,