Overview

The Distribution Integration connects your JFrog Pipeline Automation platform to a Distribution instance.



Creating an Integration

Add this integration by following steps on the Managing Pipelines Integrations page.

Here is the information you need to create this integration:

  • Name -- Choose a friendly name for the integration

  • Distribution URL  -- The Distribution URL is automatically added for the user adding the integration. If required, you can manually enter the HTTP Endpoint (URL) for your JFrog Distribution.

  • User -- The Distribution username is automatically added for the user adding the integration. If required, you can manually enter the username for your JFrog Distribution.

  • API Key -- Your Distribution API key.
    Click Get API Key to automatically fetch API key for the user adding the integration. If the API key does not exist, a new one is generated. If required, you can manually enter the API key for your JFrog Distribution.

  • Signing Key Passphrase -- Your optional GPG signing key passphase.


Usage

A Distribution integration is used in the following resources:

Default Environment Variables

When you create a DistributionRule or ReleaseBundle resource with this integration, a set of environment variables is automatically made available that you can use in your scripts.

Environment variableDescription
res_<resource_name>_sourceDistribution_urlDistribution URL
res_<resource_name>_sourceDistribution_userUsername supplied in the integration
res_<resource_name>_sourceDistribution_apikeyAPI Key supplied in the integration
res_<resource_name>_sourceDistribution_signingKeyPassphraseGPG signing key passphrase supplied in the integration


When you add this integration directly to a step, a set of environment variables is automatically made available that you can use in your scripts.

Environment variableDescription
int_<integration_name>_urlDistribution URL
int_<integration_name>_userUsername supplied in the integration
int_<integration_name>_apikeyAPI Key supplied in the integration
int_<integration_name>_signingKeyPassphraseGPG signing key passphrase supplied in the integration

Examples

This example uses a BuildInfo resource to create, sign and distribute a release bundle.  It assumes that a Distribution integration named myDist has been created.

template: true   # required for local templates
valuesFilePath: ./values.yml

resources:
  # Build info of first build to bundle
  - name: gosvc_promoted_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: {{ .Values.myArtifactoryIntegration }}
      buildName: svc_build
      buildNumber: 1

  # Build info of second build to bundle
  - name: appl_promoted_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: {{ .Values.demoArtifactoryIntegration }}
      buildName: backend_build
      buildNumber: 1

  # Release bundle
  - name: release_bundle
    type: ReleaseBundle
    configuration:
      sourceDistribution: {{ .Values.distributionIntegration }}
      name: demo_rb
      version: v1.0.0

  # Signed version of the same release bundle
  - name: signed_bundle
    type: ReleaseBundle
    configuration:
      sourceDistribution: {{ .Values.distributionIntegration }}
      name: demo_rb
      version: v1.0.0

  # Distribution rules
  - name: distribution_rules
    type: DistributionRule
    configuration:
      sourceDistribution: {{ .Values.distributionIntegration }}
      serviceName: "*"
      siteName: "*"
      cityName: "*"
      countryCodes:
        - "CN"
        - "GB"

pipelines:
  - name: demo_release_mgmt
    steps:
      - name: bundle
        type: CreateReleaseBundle
        configuration:
          releaseBundleName: demo_rb
          releaseBundleVersion: v1.0.${run_number}
          dryRun: false
          sign: false
          description: "some random test description"
          inputResources:
            - name: gosvc_promoted_build_info
              trigger: true
            - name: appl_promoted_build_info
              trigger: true
          outputResources:
            - name: release_bundle
          releaseNotes:
            syntax: markdown
            content: |
              ## Heading
                * Bullet
                * Points
            
      - name: sign
        type: SignReleaseBundle
        configuration:
          inputResources:
            - name: release_bundle
          outputResources:
            - name: signed_bundle

      - name: distribute
        type: DistributeReleaseBundle
        configuration:
          dryRun: false
          inputResources:
            - name: signed_bundle
            - name: distribution_rules