Skip to main content

Command Palette

Search for a command to run...

Jenkins for automation testers

Published
β€’3 min readβ€’View as Markdown

Jenkins is all about configuration because it needs to control jobs, environment, tools, plugins, and pipelines. Let’s break it down step by step.


πŸ“Œ Types of Configuration in Jenkins

Jenkins has multiple layers of configuration:


1. Global Configuration (Manage Jenkins β†’ Configure System)

  • Applies to the entire Jenkins server.

  • Things you configure here:

    • JDK, Maven, Gradle installations

    • Git, SVN credentials

    • Email notifications (SMTP)

    • Environment variables

    • Plugins (e.g., Slack, SonarQube, Docker)

  • Example: Set up Maven so all jobs can use it.


2. Job/Project Configuration

  • Specific to each job (Freestyle, Maven, Pipeline, Multibranch).

  • Configurable items:

    • Source Code Management (Git, SVN)

    • Build triggers (Poll SCM, Webhooks, Schedule with CRON)

    • Build steps (Run Maven goals, Execute shell/Windows batch)

    • Post-build actions (Email, Deploy, Archive artifacts, Publish reports)


3. Node/Agent Configuration (Distributed Builds)

  • Jenkins can run builds on multiple nodes (agents/slaves).

  • Configuration includes:

    • Labels (e.g., "Windows", "Linux", "Docker")

    • Remote root directory

    • Launch method (SSH, JNLP, Docker, Cloud)

  • Helps distribute workload (e.g., run Selenium tests on multiple OS).


4. Plugin Configuration

  • Every plugin has its own config.

  • Examples:

    • Allure plugin β†’ Reporting setup

    • Slack plugin β†’ Webhook URL for notifications

    • GitHub plugin β†’ Token & repo details


5. Pipeline Configuration

  • In scripted or declarative pipelines (Jenkinsfile).

  • Configurations include:

    • Stages (Build β†’ Test β†’ Deploy)

    • Agent selection (agent any or agent { label 'linux' })

    • Tools (maven, jdk, nodejs)

    • Environment variables (env.BROWSER = "chrome")


6. Security & User Configuration

  • Manage Jenkins β†’ Configure Global Security.

  • Options:

    • Authentication (LDAP, AD, GitHub, SSO)

    • Authorization (Matrix-based, Role-based strategy)

    • Credentials (username/password, SSH keys, API tokens)


7. Build Environment Configuration

  • Inside job settings.

  • Example:

    • Delete workspace before build

    • Inject environment variables

    • Use secret credentials in builds


πŸ“Œ Summary Table

Configuration TypeScopeExamples
GlobalEntire JenkinsJDK, Maven, SMTP, Plugins
Job/ProjectSingle JobSCM, Triggers, Build Steps
Node/AgentWorker MachineLabels, Launch method
PluginPlugin-specificSlack, GitHub, SonarQube
PipelineJenkinsfileStages, Agents, Env vars
SecurityAccess ControlUsers, Roles, Credentials
Build EnvironmentInside JobEnv vars, Cleanup, Secrets

βœ… In short:

  • Global config β†’ applies to whole Jenkins

  • Job config β†’ applies only to a specific job

  • Node config β†’ applies to build agents

  • Pipeline config β†’ written in Jenkinsfile

  • Plugin & Security config β†’ extend functionality