jenkins-pipelines
FreeNo executable scriptsNot checkedJenkins 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…
by TerminalSkills★ 221 GitHub starsAbout this skill
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}/$
Install jenkins-pipelines in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the jenkins-pipelines skill do?
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.
How do I install the jenkins-pipelines skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the jenkins-pipelines skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop 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…
by Anthropicinternal-comms
A 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…
by Anthropicskill-development
This 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…
by Anthropic