jenkins-pipeline by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill jenkins-pipeline使用声明式和脚本式方法创建企业级 Jenkins 流水线,通过高级控制流自动化构建、测试和部署。
最小工作示例:
pipeline {
agent { label 'linux-docker' }
environment {
REGISTRY = 'docker.io'
IMAGE_NAME = 'myapp'
}
parameters {
string(name: 'DEPLOY_ENV', defaultValue: 'staging')
}
stages {
stage('Checkout') { steps { checkout scm } }
stage('Install') { steps { sh 'npm ci' } }
stage('Lint') { steps { sh 'npm run lint' } }
stage('Test') {
steps {
sh 'npm run test:coverage'
junit 'test-results.xml'
}
}
stage('Build') {
steps {
sh 'npm run build'
archiveArtifacts artifacts: 'dist/**/*'
}
}
// ... (完整实现请参阅参考指南)
目录下的详细实现:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/| 指南 | 内容 |
|---|---|
| 声明式流水线 (Jenkinsfile) | 声明式流水线 (Jenkinsfile) |
| 脚本式流水线 | 脚本式流水线 (Groovy)、多分支流水线、参数化流水线、带凭据的流水线 |
每周安装数
223
代码仓库
GitHub 星标数
126
首次出现
2026年1月21日
安全审计
安装于
opencode191
gemini-cli189
codex180
github-copilot165
cursor158
claude-code142
Create enterprise-grade Jenkins pipelines using declarative and scripted approaches to automate building, testing, and deploying with advanced control flow.
Minimal working example:
pipeline {
agent { label 'linux-docker' }
environment {
REGISTRY = 'docker.io'
IMAGE_NAME = 'myapp'
}
parameters {
string(name: 'DEPLOY_ENV', defaultValue: 'staging')
}
stages {
stage('Checkout') { steps { checkout scm } }
stage('Install') { steps { sh 'npm ci' } }
stage('Lint') { steps { sh 'npm run lint' } }
stage('Test') {
steps {
sh 'npm run test:coverage'
junit 'test-results.xml'
}
}
stage('Build') {
steps {
sh 'npm run build'
archiveArtifacts artifacts: 'dist/**/*'
}
}
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Declarative Pipeline (Jenkinsfile) | Declarative Pipeline (Jenkinsfile) |
| Scripted Pipeline | Scripted Pipeline (Groovy), Multi-Branch Pipeline, Parameterized Pipeline, Pipeline with Credentials |
Weekly Installs
223
Repository
GitHub Stars
126
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode191
gemini-cli189
codex180
github-copilot165
cursor158
claude-code142