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

IBM and SAP unlock business and industry value with new generative AI solutions 

3 min read - IBM Consulting is delivering on our commitment to co-innovate with SAP and collaborate with our clients. As part of our Value Generation Partnership initiative announced earlier this month with SAP, we are releasing the first 10 of 100 planned AI solutions to help clients transform their industries, optimize their business processes and successfully deliver their SAP programs.  Delivering AI business and industry innovation at scale  With the recently announced Value Generation Partnership initiative, IBM and SAP are co-innovating intelligent industry…

IBM SevOne 7.0: Reaching application-centric multicloud network observability  

2 min read - As enterprises increasingly rely on network connectivity to support cloud-based applications and remote workers, network managers require new methods to monitor and safeguard connectivity across diverse environments, including corporate networks, software-defined WANs and multiple public cloud providers.   According to the recent EMA Network Megatrends Report, responding network professionals believe that 53% of network outages and performance issues could be prevented with improved network management tools, yet only 9% find it very easy to hire skilled networking personnel. This is why…

IBM Hybrid Cloud Mesh and Red Hat Service Interconnect: A new era of app-centric connectivity 

2 min read - To meet customer demands, applications are expected to be performing at their best at all times. Simultaneously, applications need to be flexible and cost effective, and therefore supported by an underlying infrastructure that is equally reliant, performant and secure as the applications themselves.   Easier said than done. According to EMA's 2024 Network Management Megatrends report only 42% of responding IT professionals would rate their network operations as successful.   In this era of hyper-distributed infrastructure where our users, apps, and data…

IBM Newsletters

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