jenkins
Skill7 starsChanged 9 months agoMITView on GitHub
Jenkins CI/CD 操作。用于:(1) 触发 Jenkins 任务构建 (2) 查询任务状态和构建历史 (3) 获取构建日志 (4) 操作 Jenkins 节点和配置
- Reads credentials
- Sends data out
4 other projects use a version of this.
Adopted by
Most recently taken up by
- rezkam/boring-but-goodtheir own version, first seen Aug 30, 2026
- yuelenghan/orbittheir own version, first seen Jun 24, 2026
- DongDuong2001/pudo-code-systemtheir own version, first seen Jun 18, 2026
- Mark20251104/skillstheir own version, first seen Apr 22, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- DongDuong2001/pudo-code-system★ 5same name
- rezkam/boring-but-good★ 1same name
- Mark20251104/skills★ 0same name
- yuelenghan/orbit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Files
Jenkins Skill
配置
# ~/.openclaw/workspace/.env
JENKINS_URL=http://jenkins.example.com:8080
JENKINS_USER=admin
JENKINS_TOKEN=your-api-token获取 Token
- 登录 Jenkins
- 点击右上角用户名 → Configure
- 在 "API Token" 部分点击 "Add new Token"
- 复制生成的 token
操作示例
source ~/.openclaw/workspace/.env触发构建
source ~/.openclaw/workspace/.env
# 带参数构建
curl -X POST "$JENKINS_URL/job/JOB_NAME/buildWithParameters" \
-u "$JENKINS_USER:$JENKINS_TOKEN" \
-d "PARAM1=value1&PARAM2=value2"
# 普通构建
curl -X POST "$JENKINS_URL/job/JOB_NAME/build" \
-u "$JENKINS_USER:$JENKINS_TOKEN"查询任务状态
source ~/.openclaw/workspace/.env
# 获取任务列表
curl -s "$JENKINS_URL/api/json?tree=jobs[name,url,color]" \
-u "$JENKINS_USER:$JENKINS_TOKEN" | jq '.jobs[]'
# 获取任务详情
curl -s "$JENKINS_URL/job/JOB_NAME/api/json" \
-u "$JENKINS_USER:$JENKINS_TOKEN"
# 获取最后一次构建状态
curl -s "$JENKINS_URL/job/JOB_NAME/lastBuild/api/json" \
-u "$JENKINS_USER:$JENKINS_TOKEN"获取构建日志
source ~/.openclaw/workspace/.env
# 控制台输出
curl -s "$JENKINS_URL/job/JOB_NAME/BUILD_NUMBER/consoleText" \
-u "$JENKINS_USER:$JENKINS_TOKEN"
# JSON 格式日志
curl -s "$JENKINS_URL/job/JOB_NAME/BUILD_NUMBER/logText/progressiveText" \
-u "$JENKINS_USER:$JENKINS_TOKEN"停止/重启构建
source ~/.openclaw/workspace/.env
# 停止构建
curl -X POST "$JENKINS_URL/job/JOB_NAME/BUILD_NUMBER/stop" \
-u "$JENKINS_USER:$JENKINS_TOKEN"
# 禁用任务
curl -X POST "$JENKINS_URL/job/JOB_NAME/disable" \
-u "$JENKINS_USER:$JENKINS_TOKEN"
# 启用任务
curl -X POST "$JENKINS_URL/job/JOB_NAME/enable" \
-u "$JENKINS_USER:$JENKINS_TOKEN"常用场景
- 触发构建: 传入参数启动构建任务
- 查看状态: 检查构建是否成功
- 获取日志: 查看构建失败原因
- 查询历史: 查看历史构建记录
使用场景
场景 1: 触发构建并等待结果
触发 CI 流水线并等待完成:
source ~/.openclaw/workspace/.env
# 触发构建
BUILD_URL=$(curl -s -X POST "$JENKINS_URL/job/deploy-prod/buildWithParameters" \
-u "$JENKINS_USER:$JENKINS_TOKEN" \
-d "VERSION=1.0.0&ENV=prod" -w "%{url}")
# 等待构建完成
while true; do
STATUS=$(curl -s "$BUILD_URL/api/json" -u "$JENKINS_USER:$JENKINS_TOKEN" | \
jq -r '.result')
if [[ "$STATUS" != "null" ]]; then
echo "Build $STATUS"
break
fi
sleep 10
done场景 2: 回滚到上一个稳定版本
查询历史构建,找到上一个成功版本:
source ~/.openclaw/workspace/.env
# 获取最近成功构建号
LAST_SUCCESS=$(curl -s "$JENKINS_URL/job/my-app/api/json" \
-u "$JENKINS_USER:$JENKINS_TOKEN" | \
jq -r '.builds[].number | select(.result == "SUCCESS") | .number' | head -1)
# 触发回滚
curl -X POST "$JENKINS_URL/job/my-app/$LAST_SUCCESS/replay" \
-u "$JENKINS_USER:$JENKINS_TOKEN"场景 3: 批量操作多个任务
触发多个项目同时构建:
source ~/.openclaw/workspace/.env
# 项目列表
PROJECTS=("frontend" "backend" "api-gateway")
for proj in "${PROJECTS[@]}"; do
echo "Building $proj..."
curl -s -X POST "$JENKINS_URL/job/$proj/build" \
-u "$JENKINS_USER:$JENKINS_TOKEN" &
done
wait
echo "All builds triggered"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

