jenkins

📁 g1joshi/agent-skills 📅 3 days ago
1
总安装量
1
周安装量
#54134
全站排名
安装命令
npx skills add https://github.com/g1joshi/agent-skills --skill jenkins

Agent 安装分布

mcpjam 1
claude-code 1
replit 1
junie 1
zencoder 1

Skill 文档

Jenkins

Jenkins is the grandfather of CI, but still widely used in enterprise. In 2025, it runs primarily as Code (Jenkinsfile) and often on Kubernetes.

When to Use

  • Legacy/Enterprise: You have massive, complex, custom requirements that only Jenkins plugins can handle.
  • Fineness of Control: You need absolute control over the build environment.
  • On-Premise: You cannot use Cloud CI.

Quick Start (Declarative Pipeline)

// Jenkinsfile
pipeline {
    agent { docker { image 'node:20' } }
    stages {
        stage('Build') {
            steps {
                sh 'npm ci'
                sh 'npm run build'
            }
        }
    }
}

Core Concepts

Master / Agent

Master (Controller) orchestrates. Agents (Executors) run the jobs. 2025 Best Practice: Ephemeral Agents on Kubernetes.

Plugins

The ecosystem is huge. Blue Ocean, Credentials Binding, Git.

CasC (Configuration as Code)

Configure the Jenkins Master itself using YAML, not the UI.

Best Practices (2025)

Do:

  • Use Declarative Pipelines: Avoid Scripted Pipelines unless absolutely necessary.
  • Use Ephemeral Agents: Spin up a Pod for each build, destroy it after. No “Snowflake” build servers.
  • Use Shared Libraries: For reusable Groovy logic across pipelines.

Don’t:

  • Don’t configure jobs in UI: Always use Jenkinsfile.
  • Don’t overload the Master: Run zero builds on the built-in controller node.

References