August 1, 2022 By Steven Weaver 4 min read

We’re excited to announce the availability of the Toolchains-as-Code Open Beta in IBM Cloud Continuous Delivery.

You can now manage your DevOps toolchains and Tekton delivery pipelines as code artifacts and automate their creation, updating and deletion from the command line.

What are Toolchains-as-Code?

In IBM Cloud Continuous Delivery, a toolchain is a set of tool integrations that support development, deployment and operational tasks. A tool integration is an instance that represents its corresponding tool, such as IBM Cloud Security and Compliance Center, IBM Cloud Secrets Manager, a GitHub repository, Slack channel and so on. 

Within IBM Cloud Continuous Delivery, developers have been able to create and use toolchain templates, which define a specific set of tool integrations in a toolchain via the IBM Cloud Graphical User Interface (GUI), but have had a limited ability to manage and update toolchain templates for large organizations who have multiple projects using similar toolchains. 

With new requirements around regulatory and audit compliance requiring that the tools used to develop and deliver applications be managed in a similar way to application artifacts, development teams are interested in managing their toolchains in the same way that they manage their code in repositories, where they can be easily version controlled. 

In addition, providing Toolchains-as-Code in repositories allows teams to define and maintain multiple, similar toolchains through cloning, copying or exporting toolchain definitions and applying template updates into existing toolchains. Finally, with Toolchains-as-Code, teams can easily manage cross-region disaster recovery, 

For more information about the tools that are supported in Continuous Delivery, see Continuous Delivery integrations. Each toolchain is associated with a resource group, where you can manage user access control by using IBM Cloud Identity and Access Management (IAM).

Toolchains-as-Code Beta

We are announcing the Open Beta of Terraform resources, Go SDKs and HTTP APIs for working with IBM Cloud Continuous Delivery Toolchains and Tekton Pipelines. With the new capabilities, developers and development teams can do the following:

  • Configure Toolchains and Tekton Pipelines-as-Code and use the Terraform CLI or IBM Cloud Schematics to automate the creation, updating and deletion of Toolchain and Tekton Pipeline resources. 
  • Express current IBM Cloud Toolchain Templates in Terraform, then plan and apply such Terraform for purposes of creating and incrementally updating toolchains. 
  • Version control Terraform toolchain templates, including all tool configurations and pipelines.
  • Work with Toolchains and Tekton Pipelines in a less declarative, more procedural fashion using the Go language SDKs and HTTP APIs.

All of these Open Beta “as-code” capabilities are designed to provide an alternative, complementary way of working to the long standing browser-based graphical user interface.

Example: Terraform provider for Toolchains- and Pipelines-as-Code

In the new Beta, we have added CD Toolchain and CD Tekton Pipeline resources to the IBM Cloud Terraform provider.  The IBM Cloud provider is used to manage IBM Cloud resources. 

Note: A Terraform provider is a plugin that allows users to manage an external API. Providers act as a translation layer that allows Terraform to communicate with many different cloud providers, databases and services.

In the example below, we show the Terraform code to instantiate the IBM Cloud provider and create a toolchain:

To add a tool to the toolchain, add an additional resource — in this case, for an IBM Cloud-hosted Gitlab repository:

In a similar way, you can define Tekton delivery pipeline resources in Terraform and add pipeline definitions, properties, triggers and trigger properties:

Example: HTTP APIs and Go SDK for Toolchains- and Pipelines-as-Code

We’ve published new APIs for Toolchains and Pipelines to enhance the ability of developers to create, modify and manage toolchains and Tekton delivery pipelines.

The Toolchain API provides the following functions, based on the user’s IAM permissions:

  • Read a toolchain
  • Create a toolchain
  • Update a toolchain
  • Delete a toolchain and its tool integrations
  • Read a tool
  • Provision a tool
  • Update a tool
  • De-provision a tool

We’ve also introduced an official Toolchain and Tekton Pipeline SDK for the Go programming language that allows developers to programmatically interact with toolchains. To use the Toolchain Go SDK, run the go get command to retrieve the Toolchain SDK and add it to the GOPATH workspace or to the project’s Go module dependencies:

go get -u github.com/IBM/continuous-delivery-go-sdk/cdtoolchainv2

To use the Go Toolchain SDK within a program, import the package by running the go build or go mod tidy commands to load the package:

import (
        "github.com/IBM/continuous-delivery-go-sdk/cdtoolchainv2"
)

Here’s an example of how to use the Toolchain API and Go SDK to create a toolchain:

createToolchainOptions := toolchainClient.NewCreateToolchainOptions(toolchainName, resourceGroupId)
createToolchainOptions.SetDescription(toolchainDescription)

toolchain, response, err := toolchainClient.CreateToolchain(createToolchainOptions)

The Tekton Pipeline API provides the following functions, based on the user’s IAM permissions:

  • Create Tekton pipelines
  • Get Tekton pipeline data
  • Update Tekton pipeline data
  • Delete Tekton pipeline instances

In addition, the API provides functions to create, manage, delete and edit pipeline runs, pipeline definitions, environment properties, triggers and trigger properties. 

The Tekton Pipeline API can be accessed by developers using the Python, Java, Node and Go language SDKs.

Here’s an example of how to use the Tekton Pipeline API and Python SDK to create a pipeline:

worker_with_id_model = {
  'id': 'public',
}

tekton_pipeline = cd_tekton_pipeline_service.create_tekton_pipeline(
  id='94619026-912b-4d92-8f51-6c74f0692d90',
  worker=worker_with_id_model
).get_result()

print(json.dumps(tekton_pipeline, indent=2))

Next steps

We hope you’ll give these new features a try. As with any Beta, capabilities and features are subject to change. If you’d like to share your feedback with us, you can reach out to the IBM Cloud Continuous Delivery development team by joining us on Slack.

More from Announcements

Success and recognition of IBM offerings in G2 Summer Reports  

2 min read - IBM offerings were featured in over 1,365 unique G2 reports, earning over 230 Leader badges across various categories.   This recognition is important to showcase our leading products and also to provide the unbiased validation our buyers seek. According to the 2024 G2 Software Buyer Behavior Report, “When researching software, buyers are most likely to trust information from people with similar roles and challenges, and they value transparency above other factors.”  With over 90 million visitors each year and hosting more than 2.6…

Manage the routing of your observability log and event data 

4 min read - Comprehensive environments include many sources of observable data to be aggregated and then analyzed for infrastructure and app performance management. Connecting and aggregating the data sources to observability tools need to be flexible. Some use cases might require all data to be aggregated into one common location while others have narrowed scope. Optimizing where observability data is processed enables businesses to maximize insights while managing to cost, compliance and data residency objectives.  As announced on 29 March 2024, IBM Cloud® released its next-gen observability…

Unify and share data across Netezza and watsonx.data for new generative AI applications

3 min read - In today's data and AI-driven world, organizations are generating vast amounts of data from various sources. The ability to extract value from AI initiatives relies heavily on the availability and quality of an enterprise's underlying data. In order to unlock the full potential of data for AI, organizations must be able to effectively navigate their complex IT landscapes across the hybrid cloud.   At this year’s IBM Think conference in Boston, we announced the new capabilities of IBM watsonx.data, an open…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters