Install
openclaw skills install cicd-workflowProvides CI/CD pipeline templates and interactive setup for Java + Vue projects with GitLab CI or Jenkins, supporting linting, testing, building, Dockerizing...
openclaw skills install cicd-workflowComplete CI/CD pipeline templates for Java + Vue full-stack projects, supporting GitLab CI and Jenkins with Kubernetes deployment.
This skill supports interactive step-by-step configuration with numbered options.
1. Choose Platform (GitLab CI / Jenkins)
↓
2. Choose Project Type (Java / Vue / Java+Vue)
↓
3. Choose Deployment Target (K8s / Docker / SSH)
↓
4. Choose Trigger Method (Manual / Auto / Scheduled)
↓
5. Choose Pipeline Steps (Multi-select)
↓
6. Generate Configuration
| # | Platform | Config File |
|---|---|---|
| 1 | GitLab CI | .gitlab-ci.yml |
| 2 | Jenkins | Jenkinsfile |
| # | Type | Description |
|---|---|---|
| 1 | Java Backend | Spring Boot project only |
| 2 | Vue Frontend | Vue.js project only |
| 3 | Java + Vue Fullstack | Both backend and frontend |
| # | Target | Description |
|---|---|---|
| 1 | Kubernetes | Deploy to K8s cluster with kubectl |
| 2 | Docker Server | Deploy to Docker host |
| 3 | Traditional Server (SSH) | Deploy via SSH to remote server |
| # | Method | Description |
|---|---|---|
| 1 | Manual | Trigger by "Build Now" button |
| 2 | Push Auto | Trigger on every push |
| 3 | Scheduled | Trigger by cron schedule |
| # | Step | Description |
|---|---|---|
| 1 | Lint | Code quality checks |
| 2 | Test | Unit tests with coverage |
| 3 | Build | Compile and package |
| 4 | Dockerize | Build and push Docker images |
| 5 | Deploy | Deploy to target environment |
| 6 | Notify | Send notifications |
Complete in one line:
Platform,Project,Target,Trigger,Steps
Examples:
1,3,1,1,123456 = GitLab CI + Java/Vue + K8s + Manual + All steps2,1,3,1,12356 = Jenkins + Java + SSH + Manual + No Docker1,2,1,2,123456 = GitLab CI + Vue + K8s + Auto trigger + All stepsOr step by step: Reply with one number at a time, the skill will guide you through each step.
When generating CI/CD configuration, this skill produces a complete package including:
cicd-output/
├── Jenkinsfile.txt # Pipeline configuration (rename to Jenkinsfile when using)
├── setup-guide.md # Complete setup instructions
├── systemd/
│ └── [app-name].service # systemd service file (for SSH deployment)
└── README.md # Quick reference
cicd-output/
├── .gitlab-ci.yml.txt # Pipeline configuration (rename to .gitlab-ci.yml when using)
├── setup-guide.md # Complete setup instructions
├── docker-compose.yml # Local development setup
└── README.md # Quick reference
The automatically generated setup-guide.md includes:
1. Prerequisites
2. Credential Configuration
3. Platform-Specific Setup
4. Deployment Target Setup
5. Troubleshooting
6. Customization Guide
.gitlab-ci.yml)Jenkinsfile)assets/gitlab-ci.yml.txt to your project root as .gitlab-ci.ymlDOCKER_REGISTRY - Your Docker registry URLDOCKER_NAMESPACE - Your registry namespaceK8S_NAMESPACE - Kubernetes namespaceCI_REGISTRY_USER / CI_REGISTRY_PASSWORD - Docker registry credentialsKUBE_CONFIG - Base64 encoded kubeconfigWEBHOOK_URL - Notification webhook URLassets/Jenkinsfile.txt to your project root as Jenkinsfiledocker-registry-credentials - Docker registry login (username/password)kubeconfig - Kubernetes config file (secret file)webhook-url - Notification webhook URL (secret text)Jenkinsfile Features:
when { changeset })project-root/
├── backend/ # Java Spring Boot project
│ ├── src/
│ ├── pom.xml
│ └── Dockerfile # Copy from assets/Dockerfile.java.txt
├── frontend/ # Vue.js project
│ ├── src/
│ ├── package.json
│ └── Dockerfile # Copy from assets/Dockerfile.vue.txt
├── .gitlab-ci.yml # Copy from assets/.gitlab-ci.yml.txt
├── Jenkinsfile # Copy from assets/Jenkinsfile.txt
└── k8s/
└── deployment.yml # Kubernetes manifests (from assets/)
assets/Dockerfile.java.txt - Java backend Docker image (multi-stage, Alpine-based)assets/Dockerfile.vue.txt - Vue frontend Docker image (multi-stage, Nginx-based)Note: Rename .txt files to remove the extension when using in your project.
Dockerfile.java.txt → DockerfileDockerfile.vue.txt → Dockerfile自动排除的文件类型:
.vue - Vue 单文件组件源码*.config.js/ts/mjs/cjs/json - 各种配置文件vite.config.* - Vite 配置webpack.config.* - Webpack 配置babel.config.* - Babel 配置tailwind.config.* - Tailwind 配置postcss.config.* - PostCSS 配置eslint.config.* / .eslintrc.* - ESLint 配置.prettierrc.* - Prettier 配置*.map - Source map 文件防护层级:
| 层级 | 位置 | 机制 |
|---|---|---|
| 构建时 | Dockerfile | find 命令删除上述文件 |
| 运行时 | Nginx | location 规则返回 404 |
| CI/CD | Jenkinsfile | 构建阶段扫描并删除 |
# 拒绝访问源码文件
location ~* \.vue$ { return 404; }
# 拒绝访问配置文件
location ~* (config|vite|webpack|babel|tailwind|postcss|eslint|prettier)\.config\.(js|ts|mjs|cjs|json)$ {
return 404;
}
# 拒绝访问 source map
location ~* \.map$ { return 404; }
assets/k8s-deployment.yml - Complete K8s manifests including:
assets/nginx.conf.txt - Optimized Nginx configuration for Vue SPA with:
Note: Copy and rename to nginx.conf when using.
scripts/notify.sh - Send deployment notifications to:
Usage:
export WEBHOOK_TYPE=feishu
export WEBHOOK_URL=https://open.feishu.cn/...
export PROJECT_NAME=my-app
export VERSION=1.0.0
./scripts/notify.sh success
Edit assets/k8s-deployment.yml:
resources:
requests:
memory: "512Mi" # Adjust based on your app
cpu: "250m"
limits:
memory: "1Gi"
cpu: "1000m"
GitLab CI - Remove when: manual to auto-trigger:
dockerize-java:
# ...
# when: manual # Remove or comment this line
Jenkins - Add SCM polling:
triggers {
pollSCM('H/5 * * * *') // Check every 5 minutes
}
Add staging deployment between build and production:
GitLab CI:
stages:
- lint
- test
- build
- dockerize
- deploy-staging # Add this
- deploy-production # Rename from deploy
- notify
deploy-staging:
stage: deploy-staging
script:
- kubectl set image ... -n staging
environment:
name: staging
when: manual
Add SonarQube analysis:
sonarqube:
stage: test
image: sonarsource/sonar-scanner-cli
script:
- sonar-scanner
-Dsonar.projectKey=$CI_PROJECT_NAME
-Dsonar.sources=.
-Dsonar.host.url=$SONAR_URL
-Dsonar.login=$SONAR_TOKEN
Use GitLab environments or Jenkins branches:
GitLab:
deploy:
script:
- |
if [ "$CI_COMMIT_REF_NAME" == "main" ]; then
kubectl set image ... -n production
else
kubectl set image ... -n staging
fi
Error: Build fails with "Security violation found: *.vue files in dist"
Cause: Vue build configuration may be including source files
Solution:
vite.config.js / vue.config.js for incorrect publicDir or assetsInclude.gitignore excludes source files from buildRUN find /usr/share/nginx/html -type f \
-name "*.vue" -o \
-name "*.config.js" \
-delete
Error: No such DSL method 'publishTestResults'
Solution:
junit plugin instead of custom publisherspost { always { junit ... } } blocksError: unable to prepare context: unable to evaluate symlinks
Solution:
// Use explicit build context
Dockerfile: "-f backend/Dockerfile backend/"
// Not: "-f backend/Dockerfile ."
KUBE_CONFIG is base64 encoded correctlyimagePullPolicy: Always for latest tagskubectl describe pod <pod-name>kubectl logs <pod-name>:latest in production