Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4987

jenkins

Skill này làm gì

Công cụ này giúp tạo và quản lý các quy trình tự động để xây dựng, kiểm thử và phân phối phần mềm. Nó cho phép bạn cấu hình nơi và cách các tác vụ chạy, đồng thời quản lý các tiện ích mở rộng để bổ sung tính năng.

Khi nào nên dùng

  • ✓Khi thiết lập một quy trình tự động để biên dịch và kiểm thử mã.
  • ✓Khi xác định nơi các tác vụ tự động chạy (trên máy cụ thể hoặc container).
  • ✓Khi bổ sung tính năng mới cho hệ thống tự động hóa, như tích hợp với các công cụ khác.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/jenkins/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/jenkins/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để thiết lập một pipeline xây dựng dự án Node.js và kiểm thử nó trong container Docker?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn định nghĩa các bước của quy trình trong một file cấu hình. Công cụ thực thi các bước này tuần tự hoặc song song, dùng các agent (máy hoặc container) mà bạn chỉ định.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Jenkins

Build, test, and deploy applications using Jenkins, the leading open-source automation server.

When to Use This Skill

Use this skill when:

  • Setting up Jenkins pipelines (declarative or scripted)
  • Configuring Jenkins agents and executors
  • Managing Jenkins plugins and security
  • Creating shared libraries for pipeline reuse
  • Integrating Jenkins with external tools

Prerequisites

  • Jenkins server (2.x or later)
  • Admin access to Jenkins
  • Java 11+ on Jenkins server
  • Basic Groovy understanding for pipelines

Declarative Pipeline

Create Jenkinsfile in repository root:

pipeline {
    agent any
    
    environment {
        DOCKER_REGISTRY = 'registry.example.com'
        APP_NAME = 'myapp'
    }
    
    stages {
        stage('Build') {
            steps {
                sh 'npm ci'
                sh 'npm run build'
            }
        }
        
        stage('Test') {
            steps {
                sh 'npm test'
            }
            post {
                always {
                    junit 'test-results/*.xml'
                }
            }
        }
        
        stage('Deploy') {
            when {
                branch 'main'
            }
            steps {
                sh './deploy.sh'
            }
        }
    }
    
    post {
        failure {
            mail to: 'team@example.com',
                 subject: "Pipeline Failed: ${env.JOB_NAME}",
                 body: "Check console output at ${env.BUILD_URL}"
        }
    }
}

Agent Configuration

Docker Agent

pipeline {
    agent {
        docker {
            image 'node:20'
            args '-v /tmp:/tmp'
        }
    }
    stages {
        stage('Build') {
            steps {
                sh 'npm ci && npm run build'
            }
        }
    }
}

Kubernetes Agent

pipeline {
    agent {
        kubernetes {
            yaml '''
                apiVersion: v1
                kind: Pod
                spec:
                  containers:
                  - name: node
                    image: node:20
                    command:
                    - sleep
                    args:
                    - infinity
                  - name: docker
                    image: docker:24-dind
                    securityContext:
                      privileged: true
            '''
        }
    }
    stages {
        stage('Build') {
            steps {
                container('node') {
                    sh 'npm ci && npm run build'
                }
            }
        }
    }
}

Labeled Agents

pipeline {
    agent { label 'linux && docker' }
    stages {
        stage('Build') {
            steps {
                sh 'make build'
            }
        }
    }
}

Parameters

pipeline {
    agent any
    
    parameters {
        string(name: 'BRANCH', defaultValue: 'main', description: 'Branch to build')
        choice(name: 'ENVIRONMENT', choices: ['dev', 'staging', 'prod'], description: 'Target environment')
        booleanParam(name: 'RUN_TESTS', defaultValue: true, description: 'Run tests?')
    }
    
    stages {
        stage('Deploy') {
            when {
                expression { params.ENVIRONMENT == 'prod' }
            }
            steps {
                sh "deploy.sh ${params.ENVIRONMENT}"
            }
        }
    }
}

Credentials

Using Credentials

pipeline {
    agent any
    
    environment {
        AWS_CREDS = credentials('aws-credentials')
        DOCKER_CREDS = credentials('docker-hub')
    }
    
    stages {
        stage('Deploy') {
            steps {
                withCredentials([
                    usernamePassword(
                        credentialsId: 'github-token',
                        usernameVariable: 'GH_USER',
                        passwordVariable: 'GH_TOKEN'
                    )
                ]) {
                    sh 'git push https://${GH_USER}:${GH_TOKEN}@github.com/repo.git'
                }
            }
        }
    }
}

Parallel Stages

pipeline {
    agent any
    
    stages {
        stage('Tests') {
            parallel {
                stage('Unit Tests') {
                    steps {
                        sh 'npm run test:unit'
                    }
                }
                stage('Integration Tests') {
                    steps {
                        sh 'npm run test:integration'

…
Câu hỏi thường gặp

“Pipeline” là gì?

Đó là chuỗi các bước tự động để xây dựng, kiểm thử và phân phối phần mềm.

“Agent” trong Jenkins là gì?

Đó là các môi trường (máy hoặc container) nơi các tác vụ của pipeline được thực thi.

“Plugin” là gì?

Đây là các tiện ích mở rộng bổ sung chức năng mới cho hệ thống tự động hóa.

Chi tiết

Mô tả gốc của tác giả

Create and manage Jenkins CI/CD pipelines, configure agents, manage plugins, and automate builds.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4987
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự