jenkins-pipelines
Jenkins is an open-source automation server that runs CI/CD pipelines defined as code in a Jenkinsfile. Use when the user wants to write or fix a Jenkinsfile…
от TerminalSkills★ 221 звезда на GitHub
Установить jenkins-pipelines в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Jenkins Pipelines
Overview
Creates and manages Jenkins CI/CD pipelines using both Declarative and Scripted syntax. Covers Jenkinsfile authoring, multibranch pipelines, shared libraries, Docker and Kubernetes agents, credential management, parallel execution, artifact handling, notifications, and production-grade pipeline patterns. Checked against Jenkins LTS 2.580.1.
Instructions
1. Declarative Pipeline
Steps outside the Pipeline suite come from plugins: agent { docker } and docker.build (Docker Pipeline), timestamps() (Timestamper), cleanWs() (Workspace Cleanup), slackSend (Slack Notification), junit (JUnit).
pipeline {
agent none // each stage picks its agent; no executor is held while waiting for approval
options {
timeout(time: 30, unit: 'MINUTES') // also aborts a pending approval
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '20'))
timestamps()
}
environment {
APP_NAME = 'api-server'
REGISTRY = 'registry.northwind.dev'
IMAGE = "${REGISTRY}/${APP_NAME}"
}
stages {
stage('Verify') {
agent { docker { image 'node:24-alpine' } }
environment { npm_config_cache = "${WORKSPACE}/.npm" } // Jenkins runs the container as the agent's uid, which has no writable home
stages {
stage('Install') { steps { sh 'npm ci' } }
stage('Lint & Test') {
parallel {
stage('Lint') { steps { sh 'npm run lint' } }
stage('Unit Tests') {
steps { sh 'npm test -- --coverage' }
post { always { junit 'reports/junit.xml' } }
}
stage('Security') { steps { sh 'npm audit --audit-level=high' } }
}
}
}
}
stage('Build Image') {
agent { label 'docker' } // agent with the Docker CLI and daemon access
steps {
script {
def tag = env.GIT_COMMIT.take(8)
docker.build("${IMAGE}:${tag}")
docker.withRegistry("https://${REGISTRY}", 'registry-credentials') {
docker.image("${IMAGE}:${tag}").push()
if (env.BRANCH_NAME == 'main') docker.image("${IMAGE}:${tag}").push('latest')
}
}
}
post { cleanup { cleanWs() } }
}
stage('Deploy Staging') {
when { branch 'main'; beforeAgent true }
agent { label 'docker' }
steps {
withCredentials([file(credentialsId: 'kubeconfig-staging', variable: 'KUBECONFIG')]) {
sh "helm upgrade --install ${APP_NAME} ./charts/${APP_NAME} -n staging --set image.tag=${GIT_COMMIT.take(8)} --wait"
}
}
}
stage('Deploy Production') {
when { branch 'main'; beforeInput true } // without beforeInput, every branch would prompt
input { message 'Deploy to production?'; ok 'Deploy'; submitter 'admin,platform-team' }
agent { label 'docker' }
steps {
withCredentials([file(credentialsId: 'kubeconfig-prod', variable: 'KUBECONFIG')]) {
sh "helm upgrade --install ${APP_NAME} ./charts/${APP_NAME} -n production --set image.tag=${GIT_COMMIT.take(8)} --wait --timeout 10m"
}
}
}
}
post {
success { slackSend(channel: '#deployments', color: 'good', message: "Deployed: ${env.BUILD_URL}") }
failure { slackSend(channel: '#deployments', color: 'danger', message: "Failed: ${env.BUILD_URL}") }
}
}
2. Multibranch Pipeline
when { branch } and changeRequest() only match in multibranch jobs. GitHub Branch Source already reports each build as a commit status on the branch or pull request; withChecks (GitHub Checks plugin, needs GitHub App credentials) adds a named check. The older githubNotify step is no longer recommended by its own maintainers.
stage('Deploy') {
when { anyOf { branch 'main'; branch pattern: 'release/.*', comparator: 'REGEXP' } }
steps { sh './scripts/deploy.sh' }
}
stage('PR Checks') {
when { changeRequest target: 'main' }
steps {
withChecks('Unit Tests') {
sh 'npm test'
junit 'reports/junit.xml'
}
}
}
3. Shared Libraries
A library repository holds global steps in vars/ (one file per step, e.g. buildDockerImage.groovy, deployToK8s.groovy, notifySlack.groovy), classes in src/ and non-Groovy files in resources/.
vars/buildDockerImage.groovy:
def call(Map config) {
def tag = config.tag ?: env.GIT_COMMIT.take(8)
def registry = config.registry ?: 'registry.northwind.dev'
def image = "${registry}/$
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _scores.json
FAQ
Что делает скилл jenkins-pipelines?
Jenkins is an open-source automation server that runs CI/CD pipelines defined as code in a Jenkinsfile. Use when the user wants to write or fix a Jenkinsfile (declarative or scripted), set up multibranch pipelines, run stages in Docker or Kubernetes agents, create shared libraries, bind credentials and secrets, run stages in parallel, gate a deployment behind an approval, validate a Jenkinsfile with the linter, or troubleshoot build failures. Trigger words: jenkins, jenkinsfile, jenkins pipeline, jenkins agent, jenkins shared library, jenkins docker, jenkins kubernetes, multibranch pipeline, jenkins credentials, jenkins groovy.
Как установить скилл jenkins-pipelines?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл jenkins-pipelines запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…