Jfrog Artifactory integration with CI/CD Jenkins

Suraj Gaikwad
Globant
Published in
5 min readApr 26, 2022

Introduction

JFrog Artifactory is a universal DevOps solution providing end-to-end automation and management of binaries and artifacts through the application delivery process that improves productivity across your development ecosystem. It enables freedom of choice supporting 25+ software build packages,across all major CI/CD platforms, and DevOps tools you already use. Artifactory can serve as a Kubernetes and Docker registry and comes with full CLI and REST APIs customizable to your ecosystem. An artifact repository manages your end-to-end artifact lifecycle and supports different software package management systems while providing consistency to your CI/CD workflow. An artifact repository is both a source for artifacts needed for a build and a target to deploy artifacts generated in the build process.

Typical Jfrog use cases

Jfrog artifactory used for a universal DevOps solution providing end-to-end automation and management of binaries and artifacts through the application delivery process that improves productivity across your development ecosystem. Some examples are :

https://jfrog.com/usecase/containerized-continuous-deployment-mesosphere-dcos-jfrog-artifactory-jenkins/

https://jfrog.com/usecase/automated-distribution-open-source-private-components-jfrog-bintray/

Below Points are covered in this article

  1. Prerequisites
  2. Jfrog installation On EC2 instance
  3. Creating Maven repository in jfrog
  4. Integrate Artifactory with Jenkins
  5. Summary
  6. References

1. Prerequisites

  • Jfrog supports Linux/Docker/Debian/Helm/Windows Platform.
  • Open port 8081 and 8082 in the network security group
  • Public Ip
  • Jenkins

2. Jfrog installation On EC2 instance

Follow the steps to install Jfrog on an Ec2 instance:

Open the terminal/console login as root user and install Java on Linux

# yum install java-1.8* -y

Install the Jfrog on Linux and download the zip package

# wget https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/jfrog-artifactory-oss/6.17.4/jfrog-artifactory-oss-6.17.4.zip

Unzip the file

# unzip jfrog-artifactory-oss-6.17.4.zip

Start the jfrog by using the below command

# cd artifactory-oss-6.17.4/bin/

# ./artifactory.sh start

To access the Jfrog artifactory from the browser we need the public ip address of the Ec2 instance.

http://<PUBLIC_IP_Address>:8081

By default, the username and password will be ‘admin’ and ‘password’ respectively”

Once you are logged in you will get the Jfrog Artifactory set up wizard as shown in the image below.

Now you can set up a jfrog artifactory by clicking on next. You can set a new admin password as shown in the image below.

3. Creating Maven repository in Jfrog

A repository in Maven holds build artifacts and dependencies of varying types.You can create repositories (For example),I am creating a maven repository as shown in the image below.

Whenever you create any repository, jfrog by default creates five more repositories. Repositories are divided into 3 types.

· Local repository
· Remote repository
· Virtual repository

4. Integrate Artifactory with Jenkins

You can now login to a Jenkins instance. Install the Artifactory plug-in with the help of the below path Manage Jenkins ->Jenkins Plugins->available ->artifactory.

You need to add Jfrog URL & Deployer Credentials in System Configuration with the help of the below path: Manage Jenkins -> System Configuration -> JFrog Platform Instances.

You can create one simple maven project with a clean install goal.

Post build section select Deploy artifacts to Artifactory .In this action all artifacts deploy over Jfrog artifactory. By default, the artifactory server URL is available from the system.You need to add the Target releases repository, target snapshot repository.

On the jfrog Artifactory side initially both local repositories are empty as shown in the image below.

After completion of the job, you will get Artifactory build info as shown in the image below.

Earlier libs-snapshot is empty. Now the job is deployed as an artifact over jfrog Artifactory.

Jfrog Artifactory maintains versions for each of the deployed artifacts.

5. Summary

Through this article, we were able to set up all the required prerequisites for the JFrog artifactory and integrate it with the Jenkins pipeline. If you have never used a JFrog artifactory and are looking for more hands-on experience, the best practices available on the Jfrog site are useful.

6. References

https://www.jfrog.com/confluence/display/JFROG/Onboarding+Best+Practices%3A+JFrog+Artifactory

https://www.jfrog.com/confluence/display/JFROG/JFrog+Artifactory

https://jfrog.com/knowledge-base/what-is-an-artifact-repository/

For Latest version of Artifactory OSS [download it from here] (https://jfrog.com/open-source/)

For Older version of Artifactory OSS [download it from here] (https://jfrog.bintray.com/artifactory/)

For Latest version of Artifactory Pro [download it from here] (https://jfrog.com/artifactory/)

--

--