Getting Started with Jenkins

Introduction to CI/CD

Continuous Integration (CI) and Continuous Deployment (CD) are essential practices in modern software development. CI involves automatically integrating code changes from multiple contributors into a shared repository. CD ensures that integrated code is automatically tested and deployed to production or staging environments.

Jenkins is a popular open-source automation server that facilitates CI/CD workflows, making it a cornerstone tool for DevOps teams.

Installing Jenkins

Follow these steps to install Jenkins on your system:

  1. Prerequisites: Ensure you have Java installed (Jenkins requires Java to run). Use the following command to check:
    java -version
  2. Download Jenkins: Visit the official Jenkins download page and choose the installer for your operating system.
  3. Install Jenkins: Run the installer and follow the on-screen instructions for your platform.
  4. Start Jenkins: Use the appropriate command or service management tool for your OS:
    
    # For Linux:
    sudo systemctl start jenkins
    
    # For macOS (Homebrew):
    brew services start jenkins-lts
    
    # For Windows:
    Start the Jenkins service from the Services app or Command Prompt.
                    
  5. Access Jenkins: Open your browser and navigate to http://localhost:8080. Complete the setup wizard using the initial admin password provided in the logs.

Setting Up Your First Jenkins Job

Once Jenkins is running, you can create your first job:

  1. Login: Access the Jenkins dashboard at http://localhost:8080 and log in.
  2. Create a New Job:
    1. Click New Item on the dashboard.
    2. Enter a name for your job, select Freestyle Project, and click OK.
  3. Configure the Job:
    1. In the General tab, add a description for your job.
    2. In the Source Code Management section, link your version control repository (e.g., Git).
    3. In the Build section, define build steps such as executing shell commands or running build scripts.
  4. Save and Build: Click Save, then Build Now to trigger the job. View the build status and logs in the dashboard.

Exploring the Jenkins Dashboard

The Jenkins dashboard is your central hub for managing jobs, builds, and system configurations. Key elements include:

  • New Item: Create new jobs.
  • Build Queue: View pending and active builds.
  • Manage Jenkins: Access global configurations, plugins, and system logs.
  • Job Views: Monitor the status and history of your jobs.

Spend time exploring these features to familiarize yourself with Jenkins' capabilities.

By following this guide, you’ve taken the first steps toward mastering Jenkins for your CI/CD pipeline. Stay tuned for more advanced topics!

Post a Comment

0 Comments