Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >

Search





Overview

The Artifactory Integration connects your JFrog Pipeline Automation platform to an installation of Artifactory to push artifacts including Docker images, and maintain build information.

Page Contents


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
  • Artifactory URL -- The Artifactory URL is automatically added for the user adding the integration. If required, you can manually enter the HTTP Endpoint (URL) for your JFrog Artifactory.
  • User -- The Artifactory username is automatically added for the user adding the integration. If required, you can manually enter the username for your JFrog Artifactory.
  • API key -- Your Artifactory 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 Artifactory.

Usage

With native steps: An Artifactory integration is mandatory in the integrations section of the following native steps:

In resources: An Artifactory integration must/may be used in the following resources:

      Mandatory

      Optional

Default Environment Variables

When you add this integration directly to a step, a set of environment variables is automatically made available.

Environment variable

Description

int_<integration_name>_urlURL of Artifactory
int_<integration_name>_userUsername supplied in the integration
int_<integration_name>_apikeyAccess token supplied in the integration


When you create an Aql, BuildInfo, or FileSpec resource with this integration, a set of environment variables is automatically made available in steps using that resource.

Environment variable

Description

res_<resource_name>_sourceArtifactory_urlURL of Artifactory
res_<resource_name>_sourceArtifactory_userUsername supplied in the integration
res_<resource_name>_sourceArtifactory_apikeyAccess token supplied in the integration


When you create an Image resource with this integration, a set of environment variables is automatically made available in steps using that resource.

Environment variable

Description

res_<resource_name>_registry_urlURL of Artifactory
res_<resource_name>_registry_userUsername supplied in the integration
res_<resource_name>_registry_apikeyAccess token supplied in the integration


When you create a RemoteFile resource with this integration, a set of environment variables is automatically made available in steps using that resource.

Environment variable

Description

res_<resource_name>_source_urlURL of Artifactory
res_<resource_name>_source_userUsername supplied in the integration
res_<resource_name>_source_apikeyAccess token supplied in the integration

Examples

The following example creates a Docker image that is published to Artifactory. It assumes that an Artifactory integration named myArtifactory has been created.

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

resources:
  - name: dbp_repo
    type: GitRepo
    configuration:
      gitProvider: {{ .Values.gitIntegration }}                      
      path: {{ .Values.gitRepositoryPath }} 
      branches:
        include: master

  - name: dbp_image
    type: Image
    configuration:
      registry: {{ .Values.artifactoryIntegration }}
      sourceRepository:  {{ .Values.sourceRespository }}
      imageName:  {{ .Values.artifactoryUrl }}/{{ .Values.sourceRepository }}/{{ .Values.imageName }}
      imageTag: latest
      autoPull: true
      
  - name: dbp_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: {{ .Values.artifactoryIntegration }}
      buildName: dbp_build
      buildNumber: 1    

  - name: dbp_promoted_build_info
    type: BuildInfo
    configuration:
      sourceArtifactory: {{ .Values.artifactoryIntegration }}
      buildName: dbp_build
      buildNumber: 1
      

pipelines:
  - name: pipeline_dbp
    steps:
      - name: docker_build
        type: DockerBuild
        configuration:
          affinityGroup: dbp_group          # affinity group string that is the same as specified in the DockerPush step
          dockerFileLocation: .
          dockerFileName: Dockerfile
          dockerImageName:  {{ .Values.artifactoryUrl }}/{{ .Values.sourceRepository }}/{{ .Values.imageName }}
          dockerImageTag: ${run_number}
          inputResources:
            - name: dbp_repo
          integrations:
            - name: {{ .Values.artifactoryIntegration }}

      - name: docker_push
        type: DockerPush
        configuration:
          affinityGroup: dbp_group          # affinity group string that is the same as specified in the DockerBuild step
          targetRepository: docker-local
          integrations:
            - name: {{ .Values.artifactoryIntegration }}
          inputSteps:
            - name: docker_build
          outputResources:
            - name: dbp_image

      - name: publish_dbp_build
        type: PublishBuildInfo
        configuration:
          inputSteps:
            - name: docker_push
          outputResources:
            - name: dbp_build_info

      - name: promote_dbp_build
        type: PromoteBuild
        configuration:
          targetRepository: demo-pipelines
          integrations:
            - name: {{ .Values.artifactoryIntegration }}
          inputResources:
            - name: dbp_build_info
          outputResources:
            - name: dbp_promoted_build_info
  • No labels
Copyright © 2021 JFrog Ltd.