IBM Cloud Docs
Using toolchains

Using toolchains

Open toolchains are available on IBM Cloud®. You can use a toolchain to be productive in your daily development, deployment, and operations work. After you set up a toolchain, you can add, delete, or configure tool integrations and manage access to the toolchain. For more information about working with tool integrations, see Working with tool integrations.

Managing access to toolchains

You can use the Identity and Access Management (IAM) service to manage user access to toolchains in resource groups. For more information about managing access control with IAM, see Managing user access to toolchains in resource groups.

Users with access to toolchains might be counted as authorized users of the IBM Cloud® Continuous Delivery service. For more information about how authorized users are counted, see Plan limitations and usage.

Organizing toolchains

You can add tags to your toolchains to organize them and easily find them later. A tag is a label that you assign to a toolchain for easy filtering of toolchains in your toolchains list.

  1. From the IBM Cloud console, click the menu icon hamburger icon, and select DevOps.
  2. On the Toolchains page, locate the toolchain that you want to add a tag to and click Add tags.
  3. Enter a name for the tag that you want to add to the toolchain. You can add multiple tags, which are separated by commas.
  4. Click Save.

For more information about tags, see Working with tags.

Viewing toolchain connections to apps, clusters, and services

You can view your toolchain's connections to Kubernetes clusters and services.

  1. From the IBM Cloud console, click the menu icon hamburger icon, and select DevOps.
  2. On the Toolchains page, click a toolchain to open its Overview page. Alternatively, on the App details page in your app, click the toolchain name.
  3. Select the Connections tab, and select the app, cluster, or service that you want to view.

Deleting a toolchain

You can delete a toolchain. When you delete a toolchain, all of the tool integrations that belong to that toolchain are also deleted. The deletion cannot be undone.

When you delete a Delivery Pipeline tool integration, the associated Delivery Pipeline is also deleted.

When you delete a GitHub or Git Repos and Issue Tracking tool integration, the associated repo is not deleted from GitHub or Git Repos and Issue Tracking. You must manually remove the repo.

Deleting a toolchain by using the console

  1. From the IBM Cloud console, click the menu icon hamburger icon, and select DevOps.
  2. On the Toolchains page, click a toolchain to open its Overview page. Alternatively, on the App details page in your app, click the toolchain name.
  3. Click the Actions menu and select Delete. Deleting a toolchain removes all of its tool integrations, which might delete resources that are managed by those integrations.
  4. Confirm the deletion by typing the name of the toolchain and clicking Delete.

Deleting a toolchain from the CLI (Beta)

  1. Log in to IBM Cloud by using the IBM Cloud CLI.

    ibmcloud login
    

    If the login fails, run the ibmcloud login --sso command to try again. The --sso parameter is required when you log in with a federated ID. If you use this option, go to the link that is listed in the CLI output to generate a one-time passcode.

  2. Optional. List all of the toolchains in the targeted account, region, and resource group to identify the instance that you want to delete.

    ibmcloud dev toolchains
    
  3. Delete a toolchain by running the ibmcloud dev toolchain-delete command.

    ibmcloud dev toolchain-delete TOOLCHAIN-NAME
    

The following table lists and describes each of the variables that are used in the previous steps.

Table 1. Variables for deleting the toolchain from the CLI
Variable Description
TOOLCHAIN_NAME The name of the toolchain that you want to delete.

Deleting a toolchain with the API

  1. Obtain an IAM bearer token. Alternatively, if you are using an SDK, obtain an IAM API key and set the client options by using environment variables.

    export CD_TOOLCHAIN_AUTH_TYPE=iam && \
    export CD_TOOLCHAIN_APIKEY={iam_api_key} && \
    export CD_TOOLCHAIN_URL={base_url}
    
  2. Delete the toolchain that you want to remove.

    curl -X DELETE \
      "{base_url}/toolchains/{toolchain_id}" \
      -H 'Authorization: Bearer {token}'
    
    const CdToolchainV2 = require('@ibm-cloud/continuous-delivery/cd-toolchain/v2');
    const toolchainService = CdToolchainV2.newInstance();
    ...
    (async() => {
       const response = await toolchainService.deleteToolchain({
          toolchainId: {toolchain_id}
       });
    })();
    
    import (
        "github.com/IBM/continuous-delivery-go-sdk/cdtoolchainv2"
    )
    ...
    toolchainClientOptions := &cdtoolchainv2.CdToolchainV2Options{}
    toolchainClient, err := cdtoolchainv2.NewCdToolchainV2UsingExternalConfig(toolchainClientOptions)
    deleteToolchainOptions := toolchainClient.NewDeleteToolchainOptions({toolchain_id})
    response, err := toolchainClient.DeleteToolchain(deleteToolchainOptions)
    
    from ibm_continuous_delivery.cd_toolchain_v2 import CdToolchainV2
    ...
    toolchain_service = CdToolchainV2.new_instance()
    response = toolchain_service.delete_toolchain(
       toolchain_id = toolchain_id
    )
    
    import com.ibm.cloud.continuous_delivery.cd_toolchain.v2.CdToolchain;
    import com.ibm.cloud.continuous_delivery.cd_toolchain.v2.model.*;
    ...
    CdToolchain toolchainService = CdToolchain.newInstance();
    DeleteToolchainOptions deleteToolchainOptions = new DeleteToolchainOptions.Builder()
       .toolchainId({toolchain_id})
       .build();
    Response<Void> response = toolchainService.deleteToolchain(deleteToolchainOptions).execute();
    

The following table lists and describes each of the variables that are used in the previous steps.

Table 2. Variables for deleting the toolchain with the API
Variable Description
{base_url} The Toolchain API endpoint URL, for example https://api.us-south.devops.cloud.ibm.com/toolchain/v2. For more information about this endpoint URL, including a list of values, see Endpoint URL.
{iam_api_key} Your IAM API key.
{token} A valid IAM bearer token.
{toolchain_id} The ID of the toolchain that you want to delete.

Deleting a toolchain with Terraform

  1. Locate the Terraform file (for example, main.tf) that contains the resource block for the existing toolchain. For more information about using Terraform with toolchains, see Creating a toolchain with Terraform.

    The resource in the following example describes an existing toolchain.

    data "ibm_resource_group" "group" {
      name = "default"
    }
    
    resource "ibm_cd_toolchain" "cd_toolchain" {
      name              = "my toolchain"
      resource_group_id = data.ibm_resource_group.group.id
    }
    
  2. Remove the resource block from your Terraform file.

  3. Initialize the Terraform CLI.

    terraform init
    
  4. Create a Terraform execution plan. This plan summarizes all of the actions that must run to delete the toolchain.

    terraform plan
    
  5. Apply the Terraform execution plan. Terraform takes all of the required actions to delete the toolchain.

    terraform apply