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
- 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
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
- Go to the main homepage, where you will see the job as follows
- Click on JFrog-CLI, then click on Build Now
- Click on the running build from the left hand side, in my case I have clicked on #7
- Click on Console Output
- You will see the result of the job if it is successful of not
- Output the version of JFrog CLI
- Show the JFrog CLI configuration
- Ping Artifactory
- Create a new file “test-file”
- Add the file into the repository my-repo
- Download the file into the Jenkins server
- 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
You can also verify that the file test-file has been added to the repository as seen below