Note
Artifactory Integration will be deprecated soon!
Artifactory Integration will be deprecated as announced in Artifactory version 7.47.10, hence we recommend migrating from Artifactory Integration to JFrog Platform Access Token Integration. Refer to Migrating to JFrog Platform Access Token Integration (Existing Artifactory Integration).
The Artifactory Integration connects your JFrog Pipeline Automation platform to an installation of Artifactory to push artifacts including Docker images, and maintain build information.
Creating an Artifactory 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.
Migrating to JFrog Platform Access Token Integration (Existing Artifactory Integration)
Pipelines is leveraging JFrog Platform Access Token Integration to integrate Artifactory by incorporating Artifactory URL to enhance Artifactory utilization through PAT.
Edit the existing Artifactory Integration to migrate to the JFrog Platform Access Token Integration. On successful migration, existing pipelines definition such as, steps and resources work as expected (the name of the integration remains the same thus avoiding any need for a change).
To migrate from Artifactory Integration to JFrog Platform Access Token Integration, follow these steps:
Go to Administration | Pipelines | Integrations.
Click Actions icon in line with the Integration you want to migrate to JFrog Platform Access Token Integration, and then click Edit.
Click Migrate.
Enter Platform Access Token, and then click Migrate.
Usage
With native steps: An Artifactory integration or JFrog Platform Access Token integration is mandatory in the integrations section of the following native steps:
In resources: An Artifactory integration or JFrog Platform Access Token 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 |
|---|---|
| URL of Artifactory |
| Username supplied in the integration |
| Access 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 |
|---|---|
| URL of Artifactory |
| Username supplied in the integration |
| Access 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 |
|---|---|
| URL of Artifactory |
| Username supplied in the integration |
| Access 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 |
|---|---|
| URL of Artifactory |
| Username supplied in the integration |
| Access 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.
This example uses a values.yml file to store the pipeline definitions.
In addition to the Artifactory integration, this example uses a GitHub Integration.
For a full tutorial, see Pipeline Example: Docker Build and Push.
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