hands-on lab

Create Jenkins CICD Pipeline with Artifactory Integration for Build Artifact Management

Difficulty: Intermediate
Duration: Up to 2 hours
Students: 1,083
Rating: 4.6/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Integrating Jenkins with Artifactory provides you with an automated platform for building and managing deployable artifacts (binaries).

In this lab, you will launch a Jenkins and Artifactory CICD environment using Docker containers on a provided EC2 instance. You will then configure a Jenkins build pipeline to build, compile, and package a sample Java servlet web application. The build pipeline will publish the build artifacts into Artifactory, which in turn will catalog and register them.

This lab is aimed at DevOps and CICD practitioners, and, in particular, build and release engineers interested in managing and configuring Jenkins together with Artifactory to manage and maintain build artifacts.

Lab Objectives

Upon completion of this lab, you will be able to:

  • Install and configure a Jenkins and Artifactory CICD environment using Docker containers
  • Configure Jenkins with the Gradle plugin to perform the core build and packaging for a sample Java servlet web application
  • Configure Jenkins with the Artifactory plugin for automated build artifact management
  • Create and set up a Jenkins build pipeline using a Jenkinsfile hosted within a GitHub repo
  • Use the Artifactory web application to examine and review the registered and published build artifacts

Lab Prerequisites

You should:

  • Be comfortable with SSH to remotely administer a Linux-based server
  • Be comfortable with basic Linux administration

Lab Environment

This Lab will start with the following AWS resources being provisioned automatically for you:

  • A single EC2 instance, named cicd.platform.instance, which will have a public IP address attached

To achieve the Lab end state, you will be walked through the process of:

  • SSHing into the EC2 instance, named cicd.platform.instance
    • Use Docker Compose to launch the following Docker containers:
      • Jenkins
      • Artifactory
  • Using a browser, administer and configure Jenkins - installing the required plugins. Connectivity to Jenkins will be done via the cicd.platform.instance Public IP address 
  • Using a browser, administer and configure Artifactory. Connectivity to Artifactory will be done via the cicd.platform.instance Public IP address 
  • Create a Jenkins build pipeline and configure it to build a sample Java servlet web application hosted on GitHub, with the build artifacts being automatically published into Artifactory
  • Execute the Jenkins build pipeline and confirm that it has completed successfully, publishing the build artifacts automatically into Artifactory
  • Confirm that Artifactory has received and cataloged the Jenkins build artifacts

 

Updates

January 19th, 2024 - Updated screenshots and instructions to reflect the latest UI

November 28th, 2022 - Added check

June 10th, 2022 - Updated lab to utilize EC2 Instance Connect

January 14th, 2022 - Updated instructions and screenshots to reflect the latest Jenkins UI

March 16th, 2020 - Updated the version of Gradle to avoid an issue causing the build to fail

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Connecting to the Amazon Virtual Machine Using EC2 Instance Connect
Launch Jenkins and Artifactory Docker Containers
Login to Artifactory and Complete Default Installation
Login to Jenkins and Complete the Default Installation
Install and Configure Artifactory and Gradle Plugins
Create and Execute Jenkins Pipeline Gradle Job
Review Artifactory Hosted Build Artifacts