Skip to content

cloudbees-github-actions/start-release

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Start a Release on a remote CloudBees CD/RO instance

Description

This is one of several GitHub Actions provided on an "as-is" basis by CloudBees that enable users to write GitHub Action Workflows that send work to an external CloudBees CD/RO instance. This Action enables workflows to start an existing Release on a remote CloudBees CD/RO instance.

Intended audience

For teams utilizing GitHub Actions for build and continuous integration, the CloudBees CD/RO Actions provide a mechanism for releasing software in a secure, governed and auditable manner with deep visibility, as is required in regulated industries, for example. Platform or shared services teams can build reusable content in the CloudBees CD/RO platform that conforms to company standards and removes the burden of release automation from the application teams.

Prerequisites

CloudBees CD/RO is an enterprise "on-premise" product that automates software delivery processes, including production deployments and releases. To use utilize this GitHub Action, it is necessary to have access to a CloudBees CD/RO instance, in particular,

  • A CloudBees CD/RO instance that GitHub Actions can access through REST calls (TCP port 443)
  • A valid API token for the CloudBees CD/RO instance. A token can be generated from the Access Token link on the user profile page of the CloudBees CD/RO user interface; see Manage access tokens via the UI documentation for details. These values should be stored as GitHub Action secrets to be referenced securely in a GitHub Actions workflow.

Usage

The CloudBees CD/RO GitHub Actions are called from steps in a GitHub Actions workflow. The following workflow extract illustrates how to start an existing Release on a remote CloudBees CD/RO instance, including actual parameters.

steps:
  - name: Start Release Action
    uses: cloudbees-github-actions/start-release@v1
    env:
      CDRO_URL: ${{ secrets.CDRO_URL }}
      CDRO_TOKEN: ${{ secrets.CDRO_TOKEN }}
    with:
      projectName: My project
      releaseName: My release
      pipelineParameter: |
        param1: param1 value
        param2: 1.0

Inputs

Name Description Required
projectName Project name of the release yes
releaseName Release name yes
pipelineParameter Parameters as list of key-value pairs no
ignore-unverified-cert Ignore unverified SSL certificate no

Outputs

Name Description
response The JSON data structure emited by the API call. This data can be parsed to retrieve individual values from the response, for example, ${{ fromJson(steps.start-release.outputs.response).flowRuntime.flowRuntimeId }} where start-release is the name of a previous step and .flowRuntime.flowRuntimeId is the selector for the release pipeline runtime ID.

Secrets and Variables

The following GitHub secrets are needed to start the Action. These can be set in the Secrets and variable section of the workflow repository Settings tab.

Name Description Required
CDRO_URL CloudBees CD/RO server URL, e.g., https://my-cdro.net or https://74.125.134.147 yes
CDRO_TOKEN CloudBees CD/RO API Access token yes

Examples

Create and start a Release

  1. Set up secrets in the repository settings for Actions. In the GitHub repository, select the Settings tab, Secrets, Variables, and Actions. Use the New Repository button to create the CDRO_URL and CDRO_TOKEN secrets.
  2. Create a DSL file in the root directory of your repository, for example, simple-release-dsl.groovy:
project "Default",{
	release "My simple release", {
		pipeline "GHA release pipeline",{
			formalParameter "Input1"
			formalParameter "Input2"
			formalParameter "Input3", type: "textarea"
		stage "QA"
		stage "Production"
		}
	}
}
  1. Create a new workflow file in the .github/workflows directory, for example, simple-release.yml:
name: Create and start release

on:
  workflow_dispatch:

jobs:
  create-and-start-release:
    starts-on: ubuntu-latest
    env:
      CDRO_URL: ${{ secrets.CDRO_URL }}
      CDRO_TOKEN: ${{ secrets.CDRO_TOKEN }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Create release
        uses: cloudbees-github-actions/eval-dsl@v1
        with:
          dsl-file: simple-release-dsl.groovy

      - name: start release
        uses: cloudbees-github-actions/start-release@v1
        with:
          projectName: Default
          releaseName: My simple release
          actualParameter: |
            Input1: 123
            Input1: abc
            Input1: xyz
  1. Go to the GitHub Actions tab and start the workflow Create and start release

Sample build and release repository

The CloudBees CD/RO GitHub Actions Demonstration Repository illustrates how to implement a build and release workflow with the CloudBees CD/RO GitHub Actions.

License

The scripts and documentation in this project are released under the MIT License.

Documentation

For more details about the CloudBees CD/RO product, view the online documentation.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published