Below are CI/CD examples for GitHub, GitLab, BitBucket, and CircleCI. The examples illustrate using pipelines to automate the build, test and deploy phases. Two examples per source control system are provided. One using Terraform and the other using the CLI. The README.md in the examples provide instructions for using the respective pipeline. These examples are provided as a starting point and your own unique delivery and/or deployment requirements will dictate the steps needed in your situation.

Terraform

Control Plane provides a Terraform plugin allowing you to build your Control Plane infrastructure declaratively. The following examples include the plugin installation instructions, containerizing and pushing an app to the org’s private image registry and a sample Terraform configuration file defining a GVC and a workload.

Examples

CLI

The CLI apply command creates and updates Control Plane resources. The command can be used in a pipeline to manage the deployment of an application. It takes as an input a JSON or YAML file containing the properties of the resource to manage.

The command can accept a YAML file containing multiple resources. Each resource must be separated using ---. If a resource has a reference to another resource (e.g., a workload refers to a GVC), the referenced resource must be defined in its own file and processed in order.

If the name of an exisiting resource is changed, the cpln apply command will create a new resource. Any orphaned resources will need to be manually deleted.

The examples below include installation of the CLI, containerizing and pushing an application to the org’s private repository. The examples contain two sample YAML files. One that manages a GVC, and one for a workload.

Examples

Samples of existing resources can be exported using the console or the CLI. These samples can assist when defining resources for your application.

Using the console, after selecting a resource, there will be an Export pull down button in the upper right corner. Select JSON or YAML to download the file.

Using the CLI’s get command for each resource, the -o flag can output the resource as JSON or YAML.

For example: cpln gvc get GVC_NAME -o yaml-slim --org ORG_NAME