Introduction To Jenkins
Introduction To Jenkins
Jenkins
Automating Your
Software Development Pipeline
Presented By –
Manish Kumar Rai
Agenda
● Introduction to Jenkins
● Setting Up Jenkins
● Conclusion
Introduction to
Jenkins
Jenkins is an open-source automation server that facilitates
the continuous integration and continuous delivery
(CI/CD) of software by automating the building, testing,
and deployment processes.
● Build and Deployment Automation: Jenkins automates the build and deployment processes, allowing for quick and
reliable creation of executable code and its deployment to various environments.
● Plugin Architecture: Jenkins supports a wide range of plugins that extend its functionality, enabling integration with
various tools and technologies to suit diverse project requirements.
● Pipeline as Code: Jenkins allows the definition of build and deployment processes as code (Jenkinsfile), providing
version-controlled and reproducible pipelines.
Setting up Jenkins
Setting up Jenkins involves a few key steps:
● Installation: Download and install Jenkins on your server or local machine. Follow the installation instructions provided
for your operating system.
● Access Jenkins: Once installed, access Jenkins through a web browser using the specified URL (usually
http://localhost:8080).
● Unlock Jenkins: Retrieve the initial administrator password from the Jenkins installation directory and enter it to unlock
Jenkins.
● Plugin Installation: Choose the recommended plugins during the setup process or manually select plugins based on your
project requirements.
● Admin User Creation: Create an administrator user account with a username and password for managing Jenkins.
Setting up Jenkins
cont.
● Instance Configuration:Configure Jenkins based on your preferences, including setting the Jenkins URL, system admin
email, and other global configurations.
● Start Using Jenkins:Once configured, Jenkins is ready for use. You can start creating projects, defining build jobs, and
setting up pipelines to automate your software development processes.
● Secure Jenkins(Optional): Implement security measures such as enabling authentication, managing user permissions,
and securing Jenkins with SSL if it will be used in a production environment.
Creating Your First Jenkins Job
● Login to Jenkins: Open your web browser and navigate to the Jenkins URL. Log in using the credentials you set up
during the initial configuration.
● Create a New Job: Click on "New Item" on the Jenkins dashboard.Enter a name for your job (e.g., "MyFirstJob") and
select the "Freestyle project" option.
● Configure Source Code Management (SCM): In the job configuration page, find the "Source Code Management"
section. Choose your version control system (e.g., Git) and provide the repository URL.Enter any necessary credentials
for accessing the repository.
● Configure Build Steps: Scroll down to the "Build" section.Click "Add build step" and choose the type of build step you
need (e.g., "Execute shell" for a simple shell command).Enter the command or build script relevant to your project.
Creating Your First Jenkins Job cont.
● Configure Build Triggers: Under the "Build Triggers" section, check the box next to "Build when a change is pushed to
GitHub" or select other trigger options based on your preference.
● Save the Configuration: Scroll to the bottom of the page and click "Save" to save the job configuration.
● Run the Job: On the Jenkins dashboard, find your newly created job and click "Build Now" to manually trigger the job.
● View Build Results: Once the build is complete, click on the job in the Jenkins dashboard to view the build results,
console output, and any other relevant information.
Integration with Version Control Systems
● Purpose: Jenkins integrates with Version Control Systems (e.g., Git, SVN) to automate the process of fetching source
code, enabling continuous integration and delivery.
● Configuration: In Jenkins job configuration, under "Source Code Management," select the type of VCS your project
uses (e.g., Git) and provide the repository URL.
● Credentials: Optionally, configure credentials to access the version control repository securely, especially if it is a
private repository.
● Triggering Builds: Jenkins can be configured to trigger builds automatically whenever changes are pushed to the version
control repository. This enables Continuous Integration by automatically building and testing new code changes.
Integration with Version Control Systems cont.
● Polling: Alternatively, Jenkins can periodically poll the version control system for changes and trigger a build if any are
detected.
● Branches: Specify the branch or branches to monitor, allowing Jenkins to build specific branches or pull requests.
● Changelog: Jenkins can generate a changelog based on version control commits, providing insights into what changes
are included in each build.
● Build Environment: Jenkins fetches the latest code from the version control system before each build, ensuring that the
build environment reflects the most recent state of the codebase.
Benefits of Jenkins Automation
● Automation: Jenkins automates repetitive tasks such as building, testing, and deployment, reducing manual intervention
and minimizing errors.
● Continuous Integration (CI): Jenkins facilitates continuous integration by automatically integrating code changes,
detecting and fixing issues early in the development process.
● Time and Cost Savings: Automated builds and tests save time, enabling faster feedback loops and reducing the overall
cost of development.
● Scalability: Jenkins is scalable and can be adapted to projects of various sizes and complexities, accommodating the
needs of small teams or large enterprises.
● Version Control Integration: Seamless integration with version control systems enhances traceability and collaboration,
ensuring that code changes are tracked and managed efficiently.
Conclusion
In conclusion, Jenkins stands as a powerful and versatile automation tool that revolutionizes the way we approach software
development. By seamlessly integrating into the continuous integration and continuous delivery pipelines, Jenkins automates
tedious tasks, ensures consistency, and accelerates the release process. Its adaptability to various project types, extensive
plugin ecosystem, and active community support make Jenkins an indispensable ally in the pursuit of efficient and reliable
software development practices. As we embrace Jenkins, we embark on a journey towards streamlined workflows, faster
feedback loops, and a more collaborative and automated future in software development.
Thank
You