Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
4

Query CF Helm Chart Repo query-cf-helm-repo

Query the Codefresh Helm Chart Repository for a version of a chart. Outputs whether or or not ('true' or 'false') the specified chart version was found in a variable called CHART_VER_FOUND. Can optionally throw an error for either result. Requires importing the CF_HELM_DEFAULT shared configuration into the pipeline's variables.

arguments

  • CHART_NAME - The name of the chart to look for in your Codefresh Helm Repo.
  • CHART_VERSION - The version of the chart to look for in your Codefresh Helm Repo.
  • FAIL_WHEN - Optional. The step will throw an error and fail when the query returns the specified result ('true' or 'false').
  • FAIL_WHEN_MESSAGE - Optional. Print this message whenever the pipeline fails due to the FAIL_WHEN condition being met

returns

  • CHART_VER_FOUND - Returns 'true' or 'false' to indicate whether or not the specified chart version was found
    check_repo_for_chart:
  title: Check if a chart verion is already in the repo
  type: query-cf-helm-repo
  arguments:
    CHART_NAME: my-chart
    CHART_VERSION: 0.0.1

  
    check_repo_for_chart:
  title: Fail pipeline if chart is aleady in repo
  type: query-cf-helm-repo
  arguments:
    CHART_NAME: my-chart
    CHART_VERSION: 0.0.1
    FAIL_WHEN: 'true'

  
github.com
Ted Spinks
Jul 22, 2021