Skip to content

IBM/continuous-delivery-node-sdk

IBM Cloud Continuous Delivery Node.js SDK

Build npm Release License semantic-release

The Node.js client library to interact with the IBM Cloud Continuous Delivery Toolchain and Tekton Pipeline APIs.

Table of Contents

Overview

The IBM Cloud Continuous Delivery Node.js SDK allows developers to programmatically interact with the following IBM Cloud services:

Service Name Import Path
Toolchain API @ibm-cloud/continuous-delivery/cd-toolchain/v2
Tekton Pipeline API @ibm-cloud/continuous-delivery/cd-tektonpipeline/v2

Table 1. IBM Cloud services

Migration

ibm-continuous-delivery package has been deprecated! The IBM Continuous Delivery Node SDK is now available as @ibm-cloud/continuous-delivery.

To migrate to the new package, you can use the commands listed below:

npm uninstall ibm-continuous-delivery
npm install @ibm-cloud/continuous-delivery

You will also need to modify any references to the old package ibm-continuous-delivery within import/require statements so they reflect the new package @ibm-cloud/continuous-delivery. Here is an example:

// 'require' statements that reflect the old package name:
const CdToolchainV2 = require("ibm-continuous-delivery/cd-toolchain/v2");
const CdTektonPipelineV2 = require("ibm-continuous-delivery/cd-tekton-pipeline/v2");

// Modify this to reflect the new package name:
const CdToolchainV2 = require("@ibm-cloud/continuous-delivery/cd-toolchain/v2");
const CdTektonPipelineV2 = require("@ibm-cloud/continuous-delivery/cd-tekton-pipeline/v2");

Prerequisites

  • You need an IBM Cloud account.
  • Node.js >=22: This SDK is tested with Node.js versions 22 and up. It may work on previous versions but this is not officially supported.

Installation

npm install @ibm-cloud/continuous-delivery

Using the SDK

For general SDK usage information, see IBM Cloud SDK Common README.

Development

Running Integration Tests

Integration tests run against live IBM Cloud services and require proper configuration. To run integration tests locally or in CI/CD:

Required GitHub Secrets

Configure the following secrets in your GitHub repository (Settings → Secrets and variables → Actions):

  • CLOUD_API_KEY: IBM Cloud API key with permissions to create and manage Continuous Delivery resources

Required GitHub Variables

Configure the following variables in your GitHub repository (Settings → Secrets and variables → Actions):

For CD Toolchain Service:

  • CD_TOOLCHAIN_URL: Service endpoint URL (e.g., https://api.us-south.devops.cloud.ibm.com/toolchain/v2)
  • CD_TOOLCHAIN_AUTH_TYPE: Authentication type (typically iam)
  • CD_TOOLCHAIN_EVENT_NOTIFICATIONS_SERVICE_CRN: Event Notifications service CRN for toolchain events
  • CD_TOOLCHAIN_RESOURCE_GROUP_ID: IBM Cloud resource group ID where resources will be created

For CD Tekton Pipeline Service:

  • CD_TEKTON_PIPELINE_URL: Service endpoint URL (e.g., https://api.us-south.devops.cloud.ibm.com/pipeline/v2)
  • CD_TEKTON_PIPELINE_AUTH_TYPE: Authentication type (typically iam)
  • CD_TEKTON_PIPELINE_RESOURCE_GROUP_ID: IBM Cloud resource group ID where resources will be created

Local Development

For local integration testing, create the following environment files in the project root:

cd_toolchain_v2.env:

CD_TOOLCHAIN_APIKEY=<your-ibm-cloud-api-key>
CD_TOOLCHAIN_URL=https://api.us-south.devops.cloud.ibm.com/toolchain/v2
CD_TOOLCHAIN_AUTH_TYPE=iam
CD_TOOLCHAIN_EVENT_NOTIFICATIONS_SERVICE_CRN=<your-event-notifications-crn>
CD_TOOLCHAIN_RESOURCE_GROUP_ID=<your-resource-group-id>

cd_tekton_pipeline_v2.env:

CD_TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com/pipeline/v2
CD_TEKTON_PIPELINE_AUTH_TYPE=iam
CD_TEKTON_PIPELINE_APIKEY=<your-ibm-cloud-api-key>
CD_TEKTON_PIPELINE_RESOURCE_GROUP_ID=<your-resource-group-id>
CD_TOOLCHAIN_URL=https://api.us-south.devops.cloud.ibm.com/toolchain/v2
CD_TOOLCHAIN_AUTH_TYPE=iam
CD_TOOLCHAIN_APIKEY=<your-ibm-cloud-api-key>
CD_TOOLCHAIN_RESOURCE_GROUP_ID=<your-resource-group-id>

Note: These .env files are gitignored and should never be committed to version control.

Running Tests

# Run unit tests only
npm run test-unit

# Run integration tests (requires .env files)
npm run test-integration

# Run all tests
npm test

CI/CD Integration Tests

Integration tests run automatically on pull requests. To skip integration tests in a manual workflow run:

  1. Go to Actions → pull-request workflow
  2. Click "Run workflow"
  3. Check "Skip integration tests"
  4. Click "Run workflow"

Issues

If you encounter an issue with the SDK, you are welcome to submit a bug report. Before that, please search for similar issues. It's possible someone has already encountered this issue.

Open source @ IBM

Find more open source projects on the IBM Github Page

Contributing

See CONTRIBUTING.

License

This project is released under the Apache 2.0 license. The license's full text can be found in LICENSE.

About

Node client library for IBM Cloud Continuous Delivery

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors