Jenkins for automation testers
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 anyoragent { 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 Type | Scope | Examples |
| Global | Entire Jenkins | JDK, Maven, SMTP, Plugins |
| Job/Project | Single Job | SCM, Triggers, Build Steps |
| Node/Agent | Worker Machine | Labels, Launch method |
| Plugin | Plugin-specific | Slack, GitHub, SonarQube |
| Pipeline | Jenkinsfile | Stages, Agents, Env vars |
| Security | Access Control | Users, Roles, Credentials |
| Build Environment | Inside Job | Env 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
JenkinsfilePlugin & Security config β extend functionality