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

codefresh-report-image codefresh-report-image

Report Docker Image Metadata to Codefresh CD

arguments

  • CF_API_KEY - Codefresh API KEY
  • CF_CONTAINER_REGISTRY_INTEGRATION - Codefresh CD Gitops Registry integration name.
  • CF_DOCKERFILE_CONTENT - Content of the Dockerfile used for building image base64 encoded
  • CF_DOCKERHUB_PASSWORD - When no registry integration is specified: dockerhub token as password.
  • CF_DOCKERHUB_USERNAME - When no registry integration is specified: dockerhub username.
  • CF_ENRICHERS - *deprecated* list of integrations separated by commas: Acceptable values are git, jira. ex: 'jira, git'
  • CF_GERRIT_CHANGE_ID - The change-id or a commit message that contain the change-id.
  • CF_GERRIT_HOST_URL - URL address of Gerrit instance.
  • CF_GERRIT_PASSWORD - Gerrit password.
  • CF_GERRIT_USERNAME - Gerrit username.
  • CF_GITHUB_API_HOST_URL - Specify github host api url.
  • CF_GITHUB_TOKEN - Github personal access token. Scope: repo.
  • CF_GIT_BRANCH - The git branch which is related for the commit.
  • CF_GIT_PROVIDER - The Git provider: Acceptable values are github, gitlab, bitbucket, gerrit or bitbucket-server. In case this not provided git credentials will be taken form your runtime git context
  • CF_GIT_REPO - The the git repository used for building the image.
  • CF_GIT_REVISION - The commit sha
  • CF_GOOGLE_JSON_KEY - When no registry integration is specified: JSON key for authenticating to a Google GCR or Google ACR
  • CF_GOOGLE_REGISTRY_HOST - When no registry integration is specified: the host to Google GCR or Google ACR
  • CF_HOST - *deprecated* Codefresh Runtime Ingress URL. (ie. https://codefresh.mycompany.com)
  • CF_IMAGE - Fully qualified image name to be reported to Codefresh CD. (i.e. docker.io/codefresh/example-app:1.0.0)
  • CF_ISSUE_TRACKING_INTEGRATION - The issue tracking integration name.
  • CF_JIRA_API_TOKEN - When no jira integration is specified: Jira token for authenticating.
  • CF_JIRA_EMAIL - When no jira integration is specified: user email for authenticating with jira.
  • CF_JIRA_FAIL_ON_NOT_FOUND - Fail pipeline if 'issue' not found.
  • CF_JIRA_HOST_URL - When no jira integration is specified: The jira server url. (i.e. https://codefresh-io.atlassian.net/)
  • CF_JIRA_INTEGRATION - When Codefresh GitOps jira integration name is specified instead of providing explicit credentials.
  • CF_JIRA_MESSAGE - The message to parse for JIRA ticket. (i.e. fix SA-45)
  • CF_JIRA_PROJECT_PREFIX - Jira prefix for identifying the ticket number to use. Specify one or more prefixes as a comma-separated list or as a regex. (i.e. CR, /[A-Z]{2,}-\d+/g)
  • CF_PLATFORM_URL - Required for integrations in on-premises environments only. The root URL of the codefresh application. If not specified, uses the default value of https://g.codefresh.io.
  • CF_REGISTRY_DOMAIN - When no registry integration is specified: registry domain.
  • CF_REGISTRY_INSECURE - All insecure registry.
  • CF_REGISTRY_PASSWORD - When no registry integration is specified: registry token/password.
  • CF_REGISTRY_USERNAME - When no registry integration is specified: registry username.
  • CF_RUNTIME_NAME - Name of runtime to implement the enrichment
  • CF_WORKFLOW_NAME - Given workflow name parameter.
  • DOCKERFILE_PATH - Path to the Dockerfile used for building image
  • IMAGE - Image name for step's image.
  • IMAGE_TAG - Image tag for step's image.
  • REGISTRY - Docker Registry for step's image.
    ReportImageMetadata:
  title: Report image to Codefresh CD
  type: codefresh-report-image
  working_directory: /code
  arguments:
    CF_API_KEY: codefresh-cd-api-token
    CF_IMAGE: 'docker.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:${{CF_REVISION}}'
    CF_RUNTIME_NAME: codefresh-hosted

  
    ReportImageMetadataAll:
  title: Report image to Codefresh CD
  type: codefresh-report-image
  working_directory: /code
  arguments:
    CF_API_KEY: codefresh-cd-api-token
    CF_IMAGE: 'docker.io/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:${{CF_REVISION}}'
    CF_RUNTIME_NAME: codefresh-hosted
    CF_CONTAINER_REGISTRY_INTEGRATION: docker-integration
    CF_GITHUB_TOKEN: '${{GITHUB_TOKEN}}'
    CF_GIT_PROVIDER: github
    CF_GIT_REPO: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
    CF_GIT_BRANCH: '${{CF_BRANCH}}'
    CF_GIT_REVISION: '${{CF_REVISION}}'
    CF_JIRA_API_TOKEN: '${{JIRA_TOKEN}}'
    CF_JIRA_EMAIL: dustin@codefresh.io
    CF_JIRA_HOST_URL: 'https://codefresh-io.atlassian.net'
    CF_JIRA_MESSAGE: '${{CF_COMMIT_MESSAGE}}'
    CF_JIRA_PROJECT_PREFIX: SA

  
github.com
Dustin Van Buskirk
Jun 20, 2023