← Quay lại danh sách khóa học

LAB - 1: CI/CD Pipeline for Dockerized Java Application

Tech Stack: Jenkins (Dockerized), Maven, Docker, GitHub, DockerHub; Jenkins Plugins: credentials-binding, maven-plugin, docker-build-publish, junit, github

🛠 Cập nhật: 2/7/2025

📈 Trình độ: beginner

👨‍🏫 Tác giả: OssiLV

📘 Overview

  • Built a complete CI/CD pipeline for a Java application using Jenkins Freestyle Job.
  • Automated the process: clone source from GitHub → build with Maven → run unit tests → package as Docker image → push to DockerHub.
  • Used credentials-binding plugin to securely manage DockerHub credentials.
  • Configured SCM trigger to automatically run the job on new commits.
  • Managed Jenkins as a Docker container and handled all setup via Docker Compose.

1. Các công cụ sử dụng

Thành phầnMục đích
GitHubLưu source code & Dockerfile
Jenkins (Docker)CI/CD tool để tự động build & deploy
MavenBuild app Java, chạy test
DockerĐóng gói app thành image
DockerHubNơi publish & phân phối image

2. Jenkins Plugins

PluginsMục đích chính
credentials-bindingQuản lý biến môi trường an toàn (username/password, token…) để dùng trong job/pipeline
junitHiển thị kết quả test JUnit dưới dạng báo cáo trong Jenkins UI
githubTích hợp GitHub:
- Tự động clone repo
- Trigger build khi có push
maven-pluginHỗ trợ Maven trong Jenkins Freestyle jobs
(phát hiện pom.xml, chạy mvn)
docker-build-publishCho phép Jenkins build và push image Docker dễ dàng với giao diện (Freestyle)
docker-pluginQuản lý Docker Agents/Slaves dùng Docker để chạy job hoặc spin-up containers

3. GitHub repo

https://github.com/OssiLV/Calculator