Community생산성 & 협업github.com

aj-geddes/jenkins-pipeline

선언적 및 스크립팅된 Jenkins 파이프라인을 스테이지, 에이전트, 파라미터, 플러그인과 함께 구축합니다. 멀티 브랜치 파이프라인 및 배포 자동화를 구현합니다.

jenkins-pipeline란 무엇인가요?

이 스킬은 Jenkins 파이프라인을 선언적(Declarative) 및 스크립팅된(Scripted) 두 가지 형식으로 생성하고 관리할 수 있도록 지원합니다. 주요 기능으로는 스테이지(Stage), 에이전트(Agent), 파라미터(Parameter), 플러그인(Plugin) 설정을 포함하며, 멀티 브랜치 파이프라인과 배포 자동화를 구현하는 데 특화되어 있습니다. Jenkins를 CI/CD 도구로 사용하는 개발자 및 DevOps 엔지니어에게 유용하며, 복잡한 파이프라인 로직을 간소화하고 재사용성을 높여줍니다. Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 활용할 수 있도록 설계되었으며, SKILL.md 문서를 기반으로 파이프라인 정의, 에이전트 구성, 환경 변수 설정, 플러그인 통합 등의 작업을 자동화합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aj-geddes/useful-ai-prompts/tree/main/skills/jenkins-pipeline

Installed? Explore more 생산성 & 협업 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

jenkins-pipeline은(는) 무엇을 하나요?

선언적 및 스크립팅된 Jenkins 파이프라인을 스테이지, 에이전트, 파라미터, 플러그인과 함께 구축합니다. 멀티 브랜치 파이프라인 및 배포 자동화를 구현합니다.

개요

이 스킬은 Jenkins 파이프라인을 효율적으로 생성하고 관리할 수 있는 방법을 제공합니다. 선언적(Declarative) 파이프라인과 스크립팅된(Scripted) 파이프라인 모두를 지원하며, 복잡한 CI/CD 워크플로우를 단순화합니다.

주요 기능

  • 스테이지(Stage): 빌드, 테스트, 배포 단계를 명확하게 정의
  • 에이전트(Agent): 파이프라인 실행 환경 지정 (예: Docker, Kubernetes, 노드 레이블)
  • 파라미터(Parameter): 사용자 입력을 받아 동적 파이프라인 실행
  • 플러그인(Plugin): Jenkins 플러그인을 통합하여 기능 확장
  • 멀티 브랜치 파이프라인: 여러 브랜치에 대해 자동화된 파이프라인 실행
  • 배포 자동화: 자동화된 배포 프로세스 구현

사용 예시

선언적 파이프라인 예시

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                echo 'Building...'
                // 빌드 명령어 추가
            }
        }
        stage('Test') {
            steps {
                echo 'Testing...'
                // 테스트 명령어 추가
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying...'
                // 배포 명령어 추가
            }
        }
    }
}

스크립팅된 파이프라인 예시

node {
    stage('Build') {
        echo 'Building...'
        // 빌드 명령어 추가
    }
    stage('Test') {
        echo 'Testing...'
        // 테스트 명령어 추가
    }
    stage('Deploy') {
        echo 'Deploying...'
        // 배포 명령어 추가
    }
}

구성 요소

에이전트

  • any: 사용 가능한 모든 에이전트에서 실행
  • none: 최상위에서 에이전트 미할당 (스테이지별 설정 필요)
  • label: 특정 레이블을 가진 에이전트
  • docker: Docker 컨테이너 내에서 실행
  • kubernetes: Kubernetes 파드 내에서 실행

파라미터

  • string: 문자열 입력
  • boolean: 참/거짓 선택
  • choice: 드롭다운 선택
  • password: 암호 입력

플러그인 통합

  • Git: 소스 코드 체크아웃
  • Docker: 컨테이너 이미지 빌드 및 푸시
  • Kubernetes: 쿠버네티스 클러스터 배포
  • Slack: 알림 전송
  • JUnit: 테스트 결과 보고

멀티 브랜치 파이프라인

멀티 브랜치 파이프라인을 사용하면 각 브랜치에 대해 자동으로 파이프라인이 생성됩니다. 브랜치 이름을 기준으로 파이프라인이 트리거되며, 새로운 브랜치가 생성되거나 기존 브랜치에 변경이 있을 때 실행됩니다.

pipeline {
    agent any
    triggers {
        pollSCM('H/5 * * * *')
    }
    stages {
        stage('Checkout') {
            steps {
                checkout scm
            }
        }
        stage('Build') {
            steps {
                // 브랜치별 빌드 로직
            }
        }
    }
}

배포 자동화

배포 자동화는 지속적 전달(Continuous Delivery) 및 지속적 배포(Continuous Deployment)를 구현하는 데 사용됩니다. CI/CD 프로세스에 배포 단계를 통합하여 안정적이고 반복 가능한 배포를 수행합니다.

예시: Docker 이미지로 배포

stage('Deploy to Production') {
    steps {
        script {
            sh 'docker build -t myapp:latest .'
            sh 'docker push myapp:latest'
            sh 'kubectl apply -f deployment.yaml'
        }
    }
}

환경 변수

파이프라인 내에서 환경 변수를 설정하고 사용할 수 있습니다.

pipeline {
    agent any
    environment {
        MY_VAR = 'value'
        ANOTHER_VAR = 'another_value'
    }
    stages {
        stage('Example') {
            steps {
                echo "MY_VAR is ${env.MY_VAR}"
            }
        }
    }
}

오류 처리

파이프라인 실행 중 오류 처리를 위한 try-catch 블록 및 post 섹션을 지원합니다.

stage('Deploy') {
    steps {
        script {
            try {
                sh 'deploy.sh'
            } catch (Exception e) {
                echo "Deployment failed: ${e.message}"
                currentBuild.result = 'FAILURE'
            }
        }
    }
    post {
        always {
            echo 'Cleanup tasks...'
        }
        success {
            echo 'Deployment succeeded!'
        }
        failure {
            echo 'Deployment failed!'
        }
    }
}

참고 자료

라이선스

이 스킬은 오픈 소스로 제공되며 MIT 라이선스를 따릅니다.

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

aj-geddes/android-kotlin-development

Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.

aj-geddes/ansible-automation

Infrastructure automation and configuration management using Ansible playbooks, roles, and inventory. Use for deploying applications, patching, and managing servers.

aj-geddes/architecture-diagrams

Create system architecture diagrams using Mermaid, PlantUML, C4 model, flowcharts, and sequence diagrams. Use when documenting architecture, system design, data flows, or technical workflows.

aj-geddes/code-review-analysis

Perform comprehensive code reviews with best practices, security checks, and constructive feedback. Use when reviewing pull requests, analyzing code quality, checking for security vulnerabilities, or providing code improvement suggestions.

aj-geddes/flask-api-development

Develop lightweight Flask APIs with routing, blueprints, database integration, authentication, and request/response handling. Use when building RESTful APIs, microservices, or lightweight web services with Flask.

aj-geddes/ios-swift-development

Develop native iOS apps with Swift. Covers MVVM architecture, SwiftUI, URLSession for networking, Combine for reactive programming, and Core Data persistence.

aj-geddes/markdown-documentation

Master markdown formatting, GitHub Flavored Markdown, README files, and documentation formatting. Use when writing markdown docs, READMEs, or formatting documentation.

aj-geddes/nginx-configuration

Configure Nginx web server for high-performance reverse proxy, load balancing, SSL/TLS, caching, and API gateway functionality.

aj-geddes/nodejs-express-server

Build production-ready Express.js servers with middleware, authentication, routing, and database integration. Use when creating REST APIs, managing requests/responses, implementing middleware chains, and handling server logic.

aj-geddes/rest-api-design

Design RESTful APIs following best practices for resource modeling, HTTP methods, status codes, versioning, and documentation. Use when creating new APIs, designing endpoints, or improving existing API architecture.

aj-geddes/wireframe-prototyping

Create wireframes and interactive prototypes to visualize user interfaces and gather feedback early. Use tools and techniques to communicate design ideas before development.

관련 스킬