Release to Edge Node Example: pipelines.yml

JFrog Pipelines Documentation

ft:sourceType
Paligo

The pipelines.yml file is made up of resources, pipelines and steps, as shown below. For information about the Release to Edge Node example, see Pipeline Example: Release to Edge Node.

Resources

This example uses the following types of resources:

BuildInfo

A BuildInfo resource is the metadata associated with a build in Artifactory.

JFrog Pipelines automatically creates BuildInfo when any of the Build steps like MvnBuild, NpmBuild, GradleBuild, or DockerBuild are used to generate packages. BuildInfo is published to Artifactory through the PublishBuildInfo step, by setting a flag in Build steps or by providing that resource in steps like NpmPublish, GoPublishModule, GoPublishBinary, and DockerPush.

resources

  # Build info of build to bundle
  - name: gosvc_promoted_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: {{ .Values.artifactoryIntegration }}
      buildName: dbp_build
      buildNumber: 1  

Tag

Description

Required/Optional

name

gosvc_promoted_build_info is the name of the BuildInfo resource, which is the metadata associated with the build in Artifactory.

This name is used to refer to the resource in steps, and must be unique across all repositories in your JFrog Pipelines environment.

Required

sourceArtifactory

myArtifactory is the name of the Artifactory Integration.

Required

buildName

dbp_build is the name of the build to associate with the BuildInfo.

Note

dbp_build is the name of the Docker build and push pipeline.

Optional

buildNumber

The number of the build to associate with the BuildInfo.

Optional

ReleaseBundle

A ReleaseBundleresource specifies a set of artifacts in Artifactory that are distributed to Artifactory Edge nodes as a JFrog Distribution Release Bundle.Distribute Release Bundles (v1)

This resource can be used with CreateReleaseBundle or DistributeReleaseBundle. This resource can be used to represent both signed and unsigned Release Bundle.Distribute Release Bundles (v1)

resources

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

  - name: signed_bundle
    type: ReleaseBundle
    configuration:
      sourceDistribution:  {{ .Values.distributionIntegration }}
      name: demo_rb
      version: v1.0.0

Tag

Description

Required/Optional

name

release_bundle and signed_bundle are ReleaseBundle resources. While release_bundle is the release bundle, signed_bundle is the signed version of the release bundle.

Required

sourceDistribution

myDist is the name of the Distribution Integration.

Required

version

Version number of the release bundle.

Required

DistributionRule

A DistributionRule resource is the set of Destination rules that can be applied to distributing a release bundle using JFrog Distribution.Distribute Release Bundles (v1)

resources

  - name: distribution_rules
    type: DistributionRule
    configuration:
      sourceDistribution:  {{ .Values.distributionIntegration }}
      serviceName: "*"
      siteName: "*"
      cityName: "*"
      countryCodes:
        - "*"  

Tag

Description

Required/Optional

name

distribution_rules is the name of the DistributionRule resource.

Required

sourceDistribution

myDist is the name of the Distribution Integration.

Required

serviceName

The Artifactory Edge Node service name with a wildcard pattern.

Required

siteName

The Artifactory Edge Node site name with a wildcard pattern.

Required

cityName

The Artifactory Edge Node city name with a wildcard pattern.

Required

countryCodes

The Artifactory Edge Node country codes with a wildcard pattern.

Required

Pipelines

cd_demo_release_mgmt, the pipeline definition for signing a release bundle and releasing it to an Artifactory edge node.

Steps

The cd_demo_release_mgmt pipeline is made up of the following native steps:

  • CreateReleaseBundle

  • SignReleaseBundle

  • DistributeReleaseBundle

CreateReleaseBundle

The CreateReleaseBundlenative step produces a Release Bundle for distribution to an Artifactory Edge Node . The step can be used to create a signed or unsigned release bundle.Release Bundle RepositoriesJFrog Artifactory Edge

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: false
          outputResources:
            - name: release_bundle
          releaseNotes:
            syntax: markdown
            content: |
              ## Heading
                * Bullet
                * Points

Tag

Description of usage

Required/Optional

name

bundle is the name that identifies the CreateReleaseBundle step.

Required

inputResources

Must specify eithera named BuildInforesource(s)oran Aql resource.

If BuildInfo inputresources are provided, the query for the release bundle is constructed using the buildName, buildNumber, and targetRepo of each BuildInfo input.

Required

outputResources

Must specify a ReleaseBundle resource.

The name, version, and isSigned settings in the output ReleaseBundle are updated to the step's releaseBundleName, releaseBundleVersion, and sign values respectively (or any environment variable values that replaced environment variable placeholders for those values).

Required

releaseBundleName

An alphanumeric name for the release bundle. demo_rb is the name used in this example.

Required

releaseBundleVersion

Version string for the release bundle

Required

dryRun

When set to true parse and validate only to test whether a release bundle version can be created.

Default is true.

Optional

sign

Specifies whether the release bundle version is signed.

Default is false.

Optional

storeAtSourceArtifactory

Controls whether to store release bundle version in the source Artifactorywhile signing.

Optional

description

Description of the release bundle.

Optional

releaseNotes

Describes the release notes for the release bundle version.

syntax specifies the format of release notes: plain_text, markdown, or asciidoc. Default is plain_text.

content is the release notes string in the specified syntax format. Use the | character to denote a string preserving newlines.

Optional

SignReleaseBundle

The SignReleaseBundle native step signs a Release Bundle in preparation for distributing it to Edge nodes.

steps

      - name: sign
        type: SignReleaseBundle
        configuration:
          inputResources:
            - name: release_bundle
          outputResources:
            - name: signed_bundle

Tag

Description of usage

Required/Optional

name

sign is the name that identifies the SignReleaseBundle step.

Required

inputResources

Must specify a ReleaseBundleresource whose name and version properties identify the release bundle to be signed.

This step accepts release_bundle, which is the ReleaseBundle resource, as the inputResource.

Required

outputResources

Must specify a ReleaseBundle resource. This ReleaseBundle is updated with the name and version properties of the input ReleaseBundle (release_bundle), and sets the isSigned property to true.

This step specifies signed_bundle, which is the other ReleaseBundle resource, as the outputResource.

Required

DistributeReleaseBundle

The DistributeReleaseBundle native step triggers the distribution of a Release Bundles to an Artifactory Edge Node. This step requires a signed release bundle and one or more distribution rules to successfullyexecute.JFrog Artifactory Edge

steps

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

Tag

Description of usage

Required/Optional

name

distribute is the name that identifies the DistributeReleaseBundle step.

Required

inputResources

Must specify a ReleaseBundle resource (signed_bundle) and one DistributionRule resource (distribution_rules) .

Required

dryRun

Controls whether this should be a dry run to test if the release bundle can distribute to the Edge nodes matching the distribution rule.

The default is true.

Optional