Coconote
AI notes
AI voice & video notes
Try for free
🔧
Jenkins and CI/CD Overview
Sep 8, 2024
Notes on Jenkins and Continuous Integration/Delivery
Overview of Jenkins
Jenkins is a continuous integration tool.
Automatically pulls files from GitHub and executes automation.
Continuous Integration (CI)
CI involves collaboration between development and testing teams.
Developers push code daily, and builds are created nightly in the DevOps environment.
A cyclic process where multiple builds are generated leading up to the end of the testing cycle.
Continuous integration ensures that changes are part of both local and remote repositories.
Developers must commit and push code daily.
Continuous Delivery (CD)
Continuous delivery involves releasing software to customers as soon as testing completes.
Development and testing occur simultaneously.
Successful builds are deployed into the customer environment.
DevOps Process
The DevOps cycle combines CI and CD.
The CI process focuses on development and testing.
The CD process focuses on deployment and release.
Role of Jenkins in DevOps
Jenkins automates the CI/CD pipeline, handling:
Code integration from developers (GitHub repository).
Build creation and packaging.
Execution of automation tests.
Jenkins is managed by DevOps teams and is accessed via URLs provided by an administrator.
Configuration and execution of pipelines occur in Jenkins.
Pipeline in Jenkins
A pipeline consists of several stages:
Coding
Build creation
Automation testing
Deployment
Pipelines automate the process of executing builds and tests based on a schedule.
Testing in Jenkins
Jenkins executes sanity, regression, and functional test cases.
Test cases should be part of the GitHub repository.
The default testing mode in Jenkins is headless (no UI).
Local execution should be done first before pushing tests to GitHub.
Installing Jenkins
Download Jenkins from the official website.
Choose between:
Generic Java package (WAR file) for learning.
Installer file for real environments.
Executing the WAR file:
Use the command
java -jar jenkins.war
.
Note the admin password generated during the first run.
Access Jenkins via
http://localhost:8080
and complete the setup.
Configuring Jenkins
Plugins:
Required plugins include Maven, Git, and GitHub plugins.
Paths Configuration:
Specify paths for JDK, Maven, and Git in Jenkins settings.
Running a Project in Jenkins
Create a new item in Jenkins and select Maven project.
Configure source code management with Git and provide the GitHub repository URL.
Specify build command as
test
.
Save and run the project.
Monitor build status and console output.
For local projects, select freestyle project and configure execution commands directly.
Key Takeaways
Jenkins automates build and test processes in CI/CD.
Understanding the roles of CI and CD is crucial for successful DevOps practices.
Installation and configuration of Jenkins are critical for its effective usage.
Always ensure the project is in the GitHub repository for Jenkins to access it.
📄
Full transcript