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

More accessible than ever: IBM Envizi ESG Suite now available in seven languages

2 min read - The capture, management, and reporting of environmental, social and governance (ESG) data is a topic of global relevance. IBM Envizi is making this process more accessible with this latest release of Envizi in seven languages. Customers can now view the IBM Envizi ESG Suite interface in English, French, German, Italian, Spanish, Brazilian-Portuguese, and Japanese.  Translated functionality includes key areas of the IBM Envizi user interface including home pages, summary pages, popular dashboards and PowerReports, menus, buttons, browse grids, search and…

Introducing IBM Sterling Order Management on Microsoft Azure

4 min read - IBM and Microsoft believe in providing you with the power of choice so you can leverage the industry-leading omnichannel fulfillment capabilities of Sterling Order Management Software (OMS) along with your existing skills and investment in native Azure services.  IBM and Microsoft provide you with the ability to confidently deploy Sterling OMS on Azure using Azure Red Hat OpenShift (ARO) or Azure Kubernetes Service (AKS), with the added flexibility of using multiple native Azure services. The reference architecture details are available…

IBM TechXchange underscores the importance of AI skilling and partner innovation

3 min read - Generative AI and large language models are poised to impact how we all access and use information. But as organizations race to adopt these new technologies for business, it requires a global ecosystem of partners with industry expertise to identify the right enterprise use-cases for AI and the technical skills to implement the technology. During TechXchange, IBM's premier technical learning event in Las Vegas last week, IBM Partner Plus members including our Strategic Partners, resellers, software vendors, distributors and service…

Introducing Inspiring Voices, a podcast exploring the impactful journeys of great leaders

< 1 min read - Learning about other people's careers, life challenges, and successes is a true source of inspiration that can impact our own ambitions as well as life and business choices in great ways. Brought to you by the Executive Search and Integration team at IBM, the Inspiring Voices podcast will showcase great leaders, taking you inside their personal stories about life, career choices and how to make an impact. In this first episode, host David Jones, Executive Search Lead at IBM, brings…

IBM Newsletters

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