Create JFrog CLI Global tool configuration

ARTIFACTORY: How to Use JFrog CLI in Jenkins Using JFrog Plugin

AuthorFullName__c
Afeef Khateeb
articleNumber
000005814
ft:sourceType
Salesforce
FirstPublishedDate
2023-07-13T10:17:31Z
lastModifiedDate
2023-07-13
VersionNumber
7

Once we have added the pipeline, we will start adding the tool “jfrog-cli-latest” in Jenkins to make sure that Jenkins understands what this tool is for and how to connect it to the JFrog Platform once this tool is called.

To add this tool copy “jfrog-cli-latest” and then follow these steps
  • Go to Manage Jenkins 
  • Go to system configuration section → Tools 
  • Scroll Down until the end 

User-added image

  • Click on Add JFrog CLI
  • Give it the same name as the “jfrog-cli-latest” without the two quotations 
  • Leave the version empty as we want to install the latest version from the releases.jfrog.io 

User-added image

Run a sample job

Once you have configured the following:

  • Create Credentials on Jenkins to connect it with JFrog
  • Configure JFrog Platform
  • Review a sample CLI project
  • Create JFrog CLI Global tool configuration
Then you are good to run the job by following these steps
  • Go to the main homepage, where you will see the job as follows 
User-added image
  • Click on JFrog-CLI, then click on Build Now 
User-added image
  • Click on the running build from the left hand side, in my case I have clicked on #7
User-added image
  • Click on Console Output 
User-added image
  • You will see the result of the job if it is successful of not
Once the job is done successfully, you will see the following result
  • Output the version of JFrog CLI

User-added image

  • Show the JFrog CLI configuration

User-added image

  • Ping Artifactory 

User-added image

  • Create a new file “test-file”

User-added image

  • Add the file into the repository my-repo

User-added image

  • Download the file into the Jenkins server 

User-added image

  • You can find the file downloaded in “/var/lib/jenkins/workspace/JFrog-CLI”

You can also verify that the build ran successfully from the green image on the left hand side 
User-added image

You can also verify that the file test-file has been added to the repository as seen below 
User-added image