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

jfrog-cli jfrog-cli

Publishes artifacts to a Build in Artifactory. Also allows you to run additional Jfrog CLI commands during the publishing.

arguments

  • CI - If true, disables interactive prompts and progress bar.
  • COMMANDS - Commands to execute before build publish after authorization (for `config` step)
  • GRADLE_DEPLOY_REPO - Upload gradle-built jar file to this gradle repo in Artifactory
  • IMAGE - Docker image name. This functionality is for hybrid/on-premise Runners only.
  • JFROG_ACCESS_TOKEN - JFrog Access Token, does not support jfrog rt docker commands / Xray
  • JFROG_API_KEY - JFrog API Key
  • JFROG_CLI_BUILD_NAME - Build name to be used by commands which expect a build name, unless sent as a command argument or option.
  • JFROG_CLI_BUILD_NUMBER - Build number to be used by commands which expect a build number, unless sent as a command argument or option.
  • JFROG_CLI_BUILD_URL - Sets the CI server build URL in the build-info. The 'jfrog rt build-publish' command uses the value of this environment variable, unless the --build-url command option is sent.
  • JFROG_CLI_ENV_EXCLUDE - List of case insensitive patterns in the form of 'value1;value2;...'. Environment variables match those patterns will be excluded. This environment variable is used by the 'jfrog rt build-publish' command, in case the --env-exclude command option is not sent.
  • JFROG_CLI_IMAGE - The Docker image registry/image for step.
  • JFROG_CLI_IMAGE_TAG - The Docker image tag for step.
  • JFROG_CLI_LOG_LEVEL - This variable determines the log level of the JFrog CLI.
  • JFROG_HOST - JFrog Hostname or IP.
  • JFROG_PROTOCOL - JFrog Protocol: https (default) or http.
  • JFROG_USER - JFrog Username
  • REGISTRY - Docker registry FQDN. This functionality is for hybrid/on-premise Runners only.
  • REPOSITORY - Docker repository. This functionality is for hybrid/on-premise Runners only.
  • TAG - Docker image tag. This functionality is for hybrid/on-premise Runners only.
  • XRAY_SCAN - Set true if you want to scan build with Xray
    JFrogPublishBuild:
  type: jfrog-cli
  arguments:
    JFROG_HOST: '${{JFROG_HOST}}'
    JFROG_USER: '${{JFROG_USER}}'
    JFROG_ACCESS_TOKEN: '${{JFROG_ACCESS_TOKEN}}'
    JFROG_CLI_BUILD_NAME: '${{CF_REPO_NAME}}'
    JFROG_CLI_BUILD_NUMBER: '${{CF_BUILD_ID}}'
    JFROG_CLI_BUILD_URL: '${{CF_BUILD_URL}}'

  
    JFrogPublishBuild:
  type: jfrog-cli
  arguments:
    JFROG_HOST: '${{JFROG_HOST}}'
    JFROG_USER: '${{JFROG_USER}}'
    JFROG_API_KEY: '${{JFROG_API_KEY}}'
    JFROG_CLI_BUILD_NAME: '${{CF_REPO_NAME}}'
    JFROG_CLI_BUILD_NUMBER: '${{CF_BUILD_ID}}'
    JFROG_CLI_BUILD_URL: '${{CF_BUILD_URL}}'
    IMAGE: myimage
    TAG: mytag
    REGISTRY: registry-fqdn
    REPOSITORY: repository

  
    JFrogPublishBuild:
  type: jfrog-cli
  arguments:
    JFROG_HOST: '${{JFROG_HOST}}'
    JFROG_USER: '${{JFROG_USER}}'
    JFROG_API_KEY: '${{JFROG_API_KEY}}'
    JFROG_CLI_BUILD_NAME: '${{CF_REPO_NAME}}'
    JFROG_CLI_BUILD_NUMBER: '${{CF_BUILD_ID}}'
    JFROG_CLI_BUILD_URL: '${{CF_BUILD_URL}}'
    GRADLE_DEPLOY_REPO: my-artifactory-gradle-repo

  
    JFrogPublishBuild:
  type: jfrog-cli
  arguments:
    JFROG_HOST: '${{JFROG_HOST}}'
    JFROG_USER: '${{JFROG_USER}}'
    JFROG_API_KEY: '${{JFROG_API_KEY}}'
    JFROG_CLI_BUILD_NAME: '${{CF_REPO_NAME}}'
    JFROG_CLI_BUILD_NUMBER: '${{CF_BUILD_ID}}'
    JFROG_CLI_BUILD_URL: '${{CF_BUILD_URL}}'
    IMAGE: myimage
    TAG: mytag
    REGISTRY: registry-fqdn
    REPOSITORY: repository
    XRAY_SCAN: true

  
github.com
Dustin Van Buskirk
Jun 15, 2021