The Latest JFrog Plugin for Jenkins

New and Improved Jenkins JFrog Plugin

We all know that artifact management is an important part of our development lifecycle, and if you’re using Jenkins you’ll also need to store your builds and binaries.

In the world of DevOps, efficient integration and management of artifacts and dependencies are crucial for successful software delivery. Together,  Jenkins and JFrog Artifactory offer a powerful combination for streamlined build processes. By utilizing the Jenkins JFrog Plugin, developers can enhance their Jenkins pipeline jobs with seamless integration to Artifactory, bringing numerous advantages to the software development lifecycle.

This blog post will show you how to easily integrate the JFrog Platform and specifically Artifactory with Jenkins. And now with the new Jenkins JFrog plugin you have fast access to the newest features as soon as they’re released, right from within your build jobs.

What is the Jenkins JFrog Plugin

The Jenkins JFrog Plugin allows for easy integration between Jenkins and the JFrog Platform. This integration allows your build jobs to deploy artifacts and resolve dependencies to and from Artifactory, and then have them linked to the build job that created them. It also allows scanning of artifacts and builds with JFrog Xray and distribution of software packages to remote locations using JFrog Distribution. Any of the JFrog CLI commands can be executed from within your Jenkins Pipeline job using the JFrog Plugin.

The benefits of using the JFrog plugin for Jenkins include:

Simplified Integration: Create a bridge between Jenkins and JFrog. Artifacts created by build jobs are linked to the corresponding Jenkins build, providing traceability and transparency throughout the process.

Artifact Management: Manage your team’s artifacts effectively, irrespective of the package format, simplifying dependency resolution and promoting reusability. Over 30 natively integrated package and file types, including Maven, Gradle, and Docker.

Advanced Security: Scan artifacts and builds for security vulnerabilities, license compliance violations, and other potential risks. Catch potential issues early in the pipeline, and mitigate security threats to ensure the reliability and stability of your software.

Efficient Distribution: Automate global software package distribution to remote locations, with faster deployment and seamless collaboration across distributed environments.

Seamless Pipeline Orchestration: Leverage a range of JFrog CLI commands from within your pipeline scripts, and simplify the execution of JFrog tasks, such as uploading artifacts or triggering deployments.

The new Jenkins JFrog plugin

Today, JFrog provides two different Jenkins plugins. The first JFrog Artifactory plugin exposes Groovy based pipeline APIs, while the new Jenkins JFrog plugin exposes a single step to run JFrog CLI commands. It allows you to easily run any available JFrog CLI command. Both versions are available to use according to your preference. You can always choose a specific JFrog CLI version that you want to use. It is recommended to move to the new Jenkins JFrog plugin and take advantage of the latest and greatest available functionalities.

Here’s how you can quickly get started.

How to get started

Install the JFrog Plugin by going to Manage Jenkins > Plugins and search for “JFrog”.

Install Jenkins JFrog Plugin

To use JFrog CLI in your pipeline jobs, configure it as a tool in Jenkins by going to Manage Jenkins > System > JFrog Plugin Configuration.

Use one of the following installation options:

JFrog Plugin Configuration

Configure JFrog CLI as a tool in Jenkins, to use JFrog CLI in your pipeline jobs, by going to Manage Jenkins > Global Tool Configuration.

Use one of the following installation options:

Configure JFrog CLI as a tool in Jenkins

Now you’re ready to start!

A simple example

Uploading and downloading generic files

pipeline {
    agent any
    tools {
        jfrog 'jfrog-cli'
    }
    stages {
        stage('Testing') {
            steps {
                // Show the installed version of JFrog CLI.
                jf '-v'

                // Show the configured JFrog Platform instances.
                jf 'c show'

                // Ping Artifactory.
                jf 'rt ping'

                // Create a file and upload it to a repository named 'my-repo' in Artifactory
                sh 'touch test-file'
                jf 'rt u test-file my-repo/'

                // Publish the build-info to Artifactory.
                jf 'rt bp'

                // Download the test-file
                jf 'rt dl my-repo/test-file'
            }
        }
    }
}

 

Here are some additional plugin examples to get you started.

Get started with the Jenkins JFrog Plugin

The Jenkins JFrog Plugin provides a valuable integration point between Jenkins and JFrog Artifactory, delivering enhanced artifact management and dependency resolution capabilities. By leveraging this integration, developers can streamline their build processes, automate distribution, ensure code quality through testing and analysis, and achieve efficient collaboration.

So what’s next?

  1. Read more about the Jenkins JFrog Plugin >
  2. Start your JFrog Platform free trial >
  3. Connect Jenkins and the JFrog Platform through the Jenkins JFrog Plugin.
  4. Set up your first pipeline job using the JFrog Plugin.

CloudBeesTV: How to Use the JFrog Plugin in Jenkins