Cloud customer?
 Upgrade in MyJFrog >

Search





Overview

This pipeline demonstrates the definition of a simple pipeline that creates a Distribution release bundle and releases it to an Artifactory edge node. It shows through an example of Pipelines DSL how to use Pipelines native steps


The pipeline performs the following sequence of tasks:

The pipeline will be triggered by any change in any of the BuildInfo resources used to create the release bundle. In this way, the completion of a build by another pipeline will trigger execution of this pipeline to automatically update the edge node.


Page Contents

Example YAML Files

To aid instruction, our example divides our pipeline config into two YAML files:

  1. pipelines.resources.yml – Declarations of all resources used.
  2. pipelines.steps.yml - Declaration of the workflow steps.

It would be equally valid to keep both parts in a single file, if you choose.

All pipeline definitions are global across your JFrog Pipelines. The names of your pipelines and resources need to be unique within JFrog Pipelines.

Integrations

This pipeline configuration assumes that the following integrations have been added to the JFrog Pipelines:

Resources

pipelines.resources.yml
resources:
  # Build info of first build to bundle
  - name: gosvc_promoted_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: myArtifactory
      buildName: svc_build
      buildNumber: 1

  # Build info of second build to bundle
  - name: appl_promoted_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: demoArt
      buildName: backend_build
      buildNumber: 1

  # Release bundle
  - name: release_bundle
    type: ReleaseBundle
    configuration:
      sourceDistribution: myDist
      name: demo_rb
      version: v1.0.0

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

  # Distribution rules
  - name: distribution_rules
    type: DistributionRule
    configuration:
      sourceDistribution: myDist
      serviceName: "*"
      siteName: "*"
      cityName: "*"
      countryCodes:
        - "CN"
        - "GB"


Pipeline and Steps

pipelines.steps.yml
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
Copyright © 2021 JFrog Ltd.