Product
|
Cloud costs
|
released
October 21, 2022
|
3
min read
|

How to Configure Your Builds with JFrog Artifactory and Harness

Updated

JFrog Artifactory is a solution for managing binaries, packages, and repositories, which are known as “software assets” in the world of continuous integration (CI) and delivery (CD). Artifactory helps software developers codify, store, and track files and their metadata without needing to understand their inner workings. It also offers centralized storage of binary assets, so other team members can reuse them. Since all the build artifacts and binaries are stored in a single place, Artifactory provides a single view of the entire development process, enabling developers to share their work seamlessly.

This article will explain how a developer can easily use best-of-the-breed DevOps tools, like Harness and JFrog Artifactory, to test and build with CI and store the build artifacts. This makes it easy for other developers in the team to collaborate and use the stored artifacts, which not only enhances developer productivity but also speeds up the software delivery process. 

Harness has a seamless integration with Artifactory. Users just need to set up a free trial of Harness Continuous Integration, add the test and build steps, and then push the build artifacts to Artifactory. We will see this with a simple example and learn how Artifactory and Harness work together to streamline your software development lifecycle. 

Pre-requisites

Setup

First, build a simple Java project with Maven. For the purpose of this tutorial, I have created a simple application, and you can clone it. You can find the example on Github.

Then, log in to your Harness account and create a project.

Select the continuous integration module from the list.

Start doing the project set-up by adding a Delegate to the project first. 

Note: You might be a little overwhelmed by thinking about what a delegate is and why it’s required. The Harness Delegate is a service/software you need to install/run on the target cluster (Kubernetes cluster in our case) to connect your artifacts, infrastructure, collaboration, verification, and other providers with the Harness Manager. When you set up Harness for the first time, you install a Harness Delegate. If you want to know more about Delegate, read the Harness Delegate documentation

Then add Artifactory as a new connector. 

Add your Artifactory details like URL, username, and password. Passwords are securely protected at Harness with a strongly encrypted approach. 

Make sure your connection is successful.

Next, you need to add your repo as a connector. Various code repository management platforms are supported at Harness. Since our code is on GitHub, we will select Git.

After selecting Git, add the repository details.

Make sure the connection is successful.

Now, go to creating the pipeline step and add all the relevant details.

Name the pipeline and proceed. 

Then select Build as the stage.

This step fetches our already connected GitHub repo and the connector. Click on set up stage.

Next, define the infrastructure. We are using a Kubernetes cluster, and we will specify the same.

In the execution stage, Add Step and select Run.

One more connector to add is our DockerHub Registry. Let’s add that as a connector.

Make sure the connection is successful.

Configure the run setup with the details required like name, docker registry connector, image, and command.

After adding the run step, add another step to push the build artifacts to the Artifactory.

Select JFrog Artifactory.

Mention the details required as we did in the previous step. Just make sure your target and source path is correct. 

You can see your source path in the target folder of your project after you run mvn install 

Now, we are all set. Save the settings and run the pipeline.

After the successful execution of all the steps, you should see your build artifacts getting pushed to Artifactory. Let’s verify the same by going to our Artifactory account/dashboard.

Congratulations, you just pushed our build artifacts to Artifactory with the help of Harness. 

Harness Artifactory Integration

Artifactory is one of the best solutions in the market to keep your binaries intact. In addition, it helps developers speed up the software delivery process by reusing the binaries and promoting them throughout the development pipeline. Harness is a modern software delivery platform that has a strong integration with Artifactory to help organizations simplify DevOps. 

Ready to try this out with Harness CI? Download a free trial.

Sign up now

Sign up for our free plan, start building and deploying with Harness, take your software delivery to the next level.

Get a demo

Sign up for a free 14 day trial and take your software development to the next level

Documentation

Learn intelligent software delivery at your own pace. Step-by-step tutorials, videos, and reference docs to help you deliver customer happiness.

Case studies

Learn intelligent software delivery at your own pace. Step-by-step tutorials, videos, and reference docs to help you deliver customer happiness.

We want to hear from you

Enjoyed reading this blog post or have questions or feedback?
Share your thoughts by creating a new topic in the Harness community forum.

Sign up for our monthly newsletter

Subscribe to our newsletter to receive the latest Harness content in your inbox every month.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Continuous Integration