JFrog Artifactory · Arazzo Workflow

Artifactory Publish and Promote Build

Version 1.0.0

Publish build info to Artifactory and promote the build to a release repository.

1 workflow 1 source API 1 provider
View Spec View on GitHub ArtifactsDevOpsCI/CDDocker RegistryMavenPackage ManagementRepositoryArazzoWorkflows

Provider

artifactory

Workflows

publish-and-promote-build
Publish build info, verify it, then promote the build to release.
Publishes build info, fetches it back to confirm it was stored, and promotes the build artifacts from a source repository to a target release repository.
3 steps inputs: accessToken, buildName, buildNumber, sourceRepo, started, targetRepo outputs: buildInfo, promotionStatus
1
publishBuild
publishBuildInfo
Publish the build info record so Artifactory tracks the artifacts and metadata for this build name and number.
2
getPublishedBuild
getBuildInfo
Read the published build info back to confirm it was recorded before promoting it.
3
promoteBuild
promoteBuild
Promote the build by copying its artifacts from the source staging repository to the target release repository.

Source API Descriptions

Arazzo Workflow Specification

artifactory-publish-promote-build-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Artifactory Publish and Promote Build
  summary: Publish build info to Artifactory and promote the build to a release repository.
  description: >-
    A CI/CD release flow for JFrog Artifactory. The workflow publishes build
    information for a named build and number, reads back the published build
    info to confirm it was recorded, and then promotes the build by copying its
    artifacts from a staging repository to a release repository. Every step
    spells out its request inline so the flow can be read and executed without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: artifactoryBuildApi
  url: ../openapi/artifactory-build-integration-api-openapi.yml
  type: openapi
workflows:
- workflowId: publish-and-promote-build
  summary: Publish build info, verify it, then promote the build to release.
  description: >-
    Publishes build info, fetches it back to confirm it was stored, and promotes
    the build artifacts from a source repository to a target release repository.
  inputs:
    type: object
    required:
    - accessToken
    - buildName
    - buildNumber
    - started
    - sourceRepo
    - targetRepo
    properties:
      accessToken:
        type: string
        description: Bearer access token for authenticating with Artifactory.
      buildName:
        type: string
        description: The name of the build.
      buildNumber:
        type: string
        description: The build number (version).
      started:
        type: string
        description: The build start timestamp in ISO8601 format.
      sourceRepo:
        type: string
        description: The staging repository the build artifacts currently live in.
      targetRepo:
        type: string
        description: The release repository to promote the build artifacts to.
  steps:
  - stepId: publishBuild
    description: >-
      Publish the build info record so Artifactory tracks the artifacts and
      metadata for this build name and number.
    operationId: publishBuildInfo
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    requestBody:
      contentType: application/json
      payload:
        version: "1.0.1"
        name: $inputs.buildName
        number: $inputs.buildNumber
        started: $inputs.started
        type: GENERIC
    successCriteria:
    - condition: $statusCode == 204
    outputs:
      publishStatus: $statusCode
  - stepId: getPublishedBuild
    description: >-
      Read the published build info back to confirm it was recorded before
      promoting it.
    operationId: getBuildInfo
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: buildName
      in: path
      value: $inputs.buildName
    - name: buildNumber
      in: path
      value: $inputs.buildNumber
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      buildInfo: $response.body#/buildInfo
  - stepId: promoteBuild
    description: >-
      Promote the build by copying its artifacts from the source staging
      repository to the target release repository.
    operationId: promoteBuild
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: buildName
      in: path
      value: $inputs.buildName
    - name: buildNumber
      in: path
      value: $inputs.buildNumber
    requestBody:
      contentType: application/json
      payload:
        status: Released
        comment: Promoted to release via the publish-and-promote workflow.
        sourceRepo: $inputs.sourceRepo
        targetRepo: $inputs.targetRepo
        copy: true
        artifacts: true
        dependencies: false
        failFast: true
        dryRun: false
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      promotionStatus: $response.body#/status
      promotionMessages: $response.body#/messages
  outputs:
    buildInfo: $steps.getPublishedBuild.outputs.buildInfo
    promotionStatus: $steps.promoteBuild.outputs.promotionStatus