@ibm-cloud/cd-tools 1.11.2 → 1.11.4
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/README.md +3 -3
- package/cmd/copy-toolchain.js +1 -1
- package/cmd/direct-transfer.js +15 -1
- package/config.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ The `copy-toolchain` command copies a [toolchain](https://cloud.ibm.com/docs/Con
|
|
|
106
106
|
7. Git Repos and Issue Tracking tool integrations that use Personal Access Tokens (PATs) for authentication will automatically be converted to use OAuth. You can re-configure the tool integrations after copying to use a PAT again.
|
|
107
107
|
|
|
108
108
|
### Prerequisites
|
|
109
|
-
- An [IBM Cloud API key](https://cloud.ibm.com/docs/account?topic=account-manapikey) with the IAM access listed below.
|
|
109
|
+
- An [IBM Cloud API key](https://cloud.ibm.com/docs/account?topic=account-manapikey) with the IAM access listed below. The API key must be user API key. Service ID API keys are not supported.
|
|
110
110
|
- **Viewer** access for the source Toolchain(s) being copied
|
|
111
111
|
- **Editor** access for creating new Toolchains in the target region
|
|
112
112
|
- **Administrator** access for other IBM Cloud service instances that have a tool integration with IAM service-to-service authorizations, such as [Secrets Manager](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-getting-started), [Event Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-getting-started), etc.
|
|
@@ -143,12 +143,12 @@ Examples:
|
|
|
143
143
|
Copy a toolchain to the Frankfurt region with the specified name and target resource group, using the given API key
|
|
144
144
|
|
|
145
145
|
Environment Variables:
|
|
146
|
-
IBMCLOUD_API_KEY API key used to authenticate. Must
|
|
146
|
+
IBMCLOUD_API_KEY API key used to authenticate. Must be a user API key, with IAM permission to read and create toolchains and service-to-service authorizations in source and target region / resource group
|
|
147
147
|
|
|
148
148
|
Basic options:
|
|
149
149
|
-c, --toolchain-crn <crn> The CRN of the source toolchain to copy
|
|
150
150
|
-r, --region <region> The destination region of the copied toolchain (choices: "au-syd", "br-sao", "ca-mon", "ca-tor", "eu-de", "eu-es", "eu-gb", "jp-osa", "jp-tok", "us-east", "us-south")
|
|
151
|
-
-a, --apikey <api_key> API key used to authenticate. Must
|
|
151
|
+
-a, --apikey <api_key> API key used to authenticate. Must be a user API key, with IAM permission to read and create toolchains and service-to-service authorizations in source and target region / resource group
|
|
152
152
|
-n, --name <name> (Optional) The name of the copied toolchain (default: same name as original)
|
|
153
153
|
-g, --resource-group <resource_group> (Optional) The name or ID of destination resource group of the copied toolchain (default: same resource group as original)
|
|
154
154
|
-t, --tag <tag> (Optional) The tag to add to the copied toolchain
|
package/cmd/copy-toolchain.js
CHANGED
|
@@ -50,7 +50,7 @@ const command = new Command('copy-toolchain')
|
|
|
50
50
|
.choices(TARGET_REGIONS)
|
|
51
51
|
.makeOptionMandatory()
|
|
52
52
|
)
|
|
53
|
-
.option('-a, --apikey <api_key>', 'API key used to authenticate. Must
|
|
53
|
+
.option('-a, --apikey <api_key>', 'API key used to authenticate. Must be a user API key, with IAM permission to read and create toolchains and service-to-service authorizations in source and target region / resource group')
|
|
54
54
|
.option('-n, --name <name>', '(Optional) The name of the copied toolchain (default: same name as original)')
|
|
55
55
|
.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)')
|
|
56
56
|
.option('-t, --tag <tag>', '(Optional) The tag to add to the copied toolchain')
|
package/cmd/direct-transfer.js
CHANGED
|
@@ -505,7 +505,21 @@ async function directTransfer(options) {
|
|
|
505
505
|
|
|
506
506
|
try {
|
|
507
507
|
console.log(`Fetching source group from ID: ${options.groupId}...`);
|
|
508
|
-
|
|
508
|
+
let sourceGroup;
|
|
509
|
+
try {
|
|
510
|
+
sourceGroup = await source.getGroup(options.groupId);
|
|
511
|
+
} catch (err) {
|
|
512
|
+
if (err?.response?.status === 404) {
|
|
513
|
+
console.error(
|
|
514
|
+
`Error: group "${options.groupId}" not found in source region "${options.sourceRegion}".\n` +
|
|
515
|
+
`Tip: -g accepts numeric ID or full group path like "parent/subgroup".`
|
|
516
|
+
);
|
|
517
|
+
return 1;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
console.error(`Error: failed to fetch group "${options.groupId}": ${err?.message || err}`);
|
|
521
|
+
return 1;
|
|
522
|
+
}
|
|
509
523
|
|
|
510
524
|
let destinationGroupPath = options.newGroupSlug || sourceGroup.path;
|
|
511
525
|
|
package/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Licensed Materials - Property of IBM
|
|
3
|
-
* (c) Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
* (c) Copyright IBM Corporation 2025, 2026. All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Note to U.S. Government Users Restricted Rights:
|
|
6
6
|
* Use, duplication or disclosure restricted by GSA ADP Schedule
|
|
@@ -17,7 +17,7 @@ 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 authenticate. Must
|
|
20
|
+
IBMCLOUD_API_KEY API key used to authenticate. Must be a user API key, with IAM permission to read and create toolchains and service-to-service authorizations in source and target region / resource group`;
|
|
21
21
|
|
|
22
22
|
const COPY_PROJECT_GROUP_DESC = `Copies all Git Repos and Issue Tracking projects in a group to another region.
|
|
23
23
|
|