PromoteCI

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

The PromoteCI template creates a pipeline that showcases the features of the PromoteBuild native step. These features include:

  • Promoting an Artifactory build created by another pipeline

  • Updating an output BuildInfo resource with the promoted build info

  • Optionally, using Signed Pipelines that can be connected to another pipeline

This template requires a few configurations to be set up:

PromoteCI YAML

resources:
  - name: {{ .Values.namePrefix }}_promotedBuildInfo
    type: BuildInfo
    configuration:
      sourceArtifactory: {{ .Values.artIntegration }}

pipelines:
  - name: {{ .Values.namePrefix }}_promote_ci
    configuration:
      environmentVariables:
        readOnly:
          JFROG_CLI_BUILD_NAME: ${pipeline_name}
          JFROG_CLI_BUILD_NUMBER: ${run_id}
    steps:
      - name: promote
        type: PromoteBuild
        configuration:
          inputResources:
            - name: {{ .Values.inputBuildInfoResourceName }}
            {{ if .Values.inputBuildInfoResourceBranch }}
              branch: {{ .Values.inputBuildInfoResourceBranch }}
            {{ end }}
          outputResources:
            - name: {{ .Values.namePrefix }}_promotedBuildInfo
          targetRepository: {{ .Values.targetRepository }}
        {{ if .Values.includeDependencies }}
          includeDependencies: {{ .Values.includeDependencies }}
        {{ end }}
        {{ if .Values.status }}
          status: {{ .Values.status }}
        {{ end }}
        {{ if .Values.comment }}
          comment: {{ .Values.comment }}
        {{ end }}
        {{ if .Values.copy }}
          copy: {{ .Values.copy }}
        {{ end }}
        {{ if .Values.failOnValidate }}
          failOnValidate: {{ .Values.failOnValidate }}
        {{ end }}

values.yml: This is a sample values.yml. This can be edited to create your own version of the file.

## This string will prefix the resources and pipeline, allowing you to add
## the pipeline source multiple times with unique names.
namePrefix: sample

## The name of your Artifactory integration
artIntegration: myArtIntegrationName

## The name of the BuildInfo resource referencing the build to be promoted
inputBuildInfoResourceName: myBuildInfo
## If your input BuildInfo resource is from a multi-branch pipeline source and
## you wish to use the resource from another branch, specify that branch name.
#inputBuildInfoResourceBranch: myBranchToUseAsInput

##### Promotion Info
## the repository to which to promote the build
targetRepository: myPromotionRepo
## set this to `true` to include dependencies in the promotion
#includeDependencies: true
## set this to `true` to copy and not move the promoted files
#copy: true
## set this to `true` to validate the input BuildInfo through Signed Pipelines
#failOnValidate: true
## the promotion status for the build
#status: TEST
## the promotion comment for the build
#comment: "Promoted by run number ${run_number}."