mirror of
https://github.com/appleboy/drone-jenkins.git
synced 2026-06-04 10:15:02 +08:00
docs: revise documentation for multi-platform CI/CD support
- Update project description to emphasize multi-platform CI/CD compatibility beyond Drone - Remove outdated references to Drone CI and simplify the supported usage forms; project is now offered as a CLI tool or Docker image - Add support mentions for GitHub Actions, GitLab CI, and Gitea Action across documentation - Eliminate usage examples and documentation sections specific to Drone CI from all language versions - Clarify that integration examples are covered in a separate documentation file Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
@@ -10,25 +10,25 @@
|
||||
[](https://codecov.io/gh/appleboy/drone-jenkins)
|
||||
[](https://goreportcard.com/report/github.com/appleboy/drone-jenkins)
|
||||
|
||||
A [Drone](https://github.com/drone/drone) plugin for triggering [Jenkins](https://jenkins.io/) jobs with flexible authentication and parameter support.
|
||||
A CLI tool and CI/CD plugin for triggering [Jenkins](https://jenkins.io/) jobs. Works with [GitHub Actions](https://github.com/features/actions), [GitLab CI](https://docs.gitlab.com/ee/ci/), [Gitea Action](https://docs.gitea.com/usage/actions/overview), and any platform that supports Docker containers or shell commands.
|
||||
|
||||
## Why drone-jenkins?
|
||||
|
||||
In modern enterprise environments, teams often adopt different CI/CD platforms based on their specific needs, project requirements, or historical decisions. It's common to find:
|
||||
|
||||
- **Multiple CI platforms coexisting**: Some teams use Jenkins for its extensive plugin ecosystem, while others prefer Drone for its simplicity and container-native approach.
|
||||
- **Multiple CI platforms coexisting**: Some teams use Jenkins for its extensive plugin ecosystem, while others prefer GitHub Actions or GitLab CI for their simplicity and container-native approach.
|
||||
- **Legacy systems integration**: Organizations with established Jenkins pipelines need to integrate with newer CI/CD workflows without rewriting everything.
|
||||
- **Cross-team collaboration**: Different departments may standardize on different tools, requiring seamless communication between platforms.
|
||||
|
||||
**drone-jenkins** bridges this gap by allowing CI/CD pipelines to trigger Jenkins jobs as part of their workflow. While originally designed for Drone CI, it works seamlessly with **GitHub Actions**, **GitLab CI**, and any CI platform that supports Docker containers or shell commands.
|
||||
**drone-jenkins** bridges this gap by allowing CI/CD pipelines to trigger Jenkins jobs as part of their workflow. It works seamlessly with **GitHub Actions**, **GitLab CI**, **Gitea Action**, and any CI platform that supports Docker containers or shell commands.
|
||||
|
||||
This enables:
|
||||
|
||||
- **Unified deployment pipelines**: Trigger existing Jenkins deployment jobs from any CI platform without migration
|
||||
- **Gradual migration**: Teams can incrementally move to modern CI platforms while still leveraging Jenkins jobs
|
||||
- **Best of both worlds**: Use GitHub Actions or Drone for modern containerized builds and Jenkins for specialized tasks with specific plugins
|
||||
- **Best of both worlds**: Use GitHub Actions or GitLab CI for modern containerized builds and Jenkins for specialized tasks with specific plugins
|
||||
- **Centralized orchestration**: Coordinate builds across multiple CI systems from a single pipeline
|
||||
- **Flexibility**: Available as a CLI binary, Docker image, or native plugin—use it however fits your workflow
|
||||
- **Flexibility**: Available as a CLI binary or Docker image—use it however fits your workflow
|
||||
|
||||
Whether you're managing a hybrid CI/CD environment or orchestrating complex multi-platform deployments, drone-jenkins provides the connectivity you need.
|
||||
|
||||
@@ -50,7 +50,6 @@ Whether you're managing a hybrid CI/CD environment or orchestrating complex mult
|
||||
- [Usage](#usage)
|
||||
- [Command Line](#command-line)
|
||||
- [Docker](#docker)
|
||||
- [Drone CI](#drone-ci)
|
||||
- [Development](#development)
|
||||
- [Building](#building)
|
||||
- [Testing](#testing)
|
||||
@@ -66,7 +65,7 @@ Whether you're managing a hybrid CI/CD environment or orchestrating complex mult
|
||||
- Debug mode with detailed parameter information and secure token masking
|
||||
- SSL/TLS support with custom CA certificates (PEM content, file path, or URL)
|
||||
- Cross-platform support (Linux, macOS, Windows)
|
||||
- Available as binary, Docker image, or Drone plugin
|
||||
- Available as CLI binary or Docker image
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -359,107 +358,6 @@ docker run --rm \
|
||||
ghcr.io/appleboy/drone-jenkins
|
||||
```
|
||||
|
||||
### Drone CI
|
||||
|
||||
Add the plugin to your `.drone.yml`:
|
||||
|
||||
```yaml
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: drone-jenkins-plugin
|
||||
```
|
||||
|
||||
**Multiple jobs with parameters:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job:
|
||||
- deploy-frontend
|
||||
- deploy-backend
|
||||
parameters: |
|
||||
ENVIRONMENT=production
|
||||
VERSION=${DRONE_TAG}
|
||||
COMMIT_SHA=${DRONE_COMMIT_SHA}
|
||||
BRANCH=${DRONE_BRANCH}
|
||||
```
|
||||
|
||||
**Using remote token:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
remote_token:
|
||||
from_secret: jenkins_remote_token
|
||||
job: my-jenkins-job
|
||||
```
|
||||
|
||||
**Wait for job completion:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: deploy-production
|
||||
wait: true
|
||||
poll_interval: 15s
|
||||
timeout: 1h
|
||||
```
|
||||
|
||||
**With debug mode:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: my-jenkins-job
|
||||
debug: true
|
||||
```
|
||||
|
||||
**With custom CA certificate:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: https://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: my-jenkins-job
|
||||
ca_cert:
|
||||
from_secret: jenkins_ca_cert
|
||||
```
|
||||
|
||||
For more detailed examples and advanced configurations, see [DOCS.md](DOCS.md).
|
||||
|
||||
## Development
|
||||
|
||||
+6
-108
@@ -10,25 +10,25 @@
|
||||
[](https://codecov.io/gh/appleboy/drone-jenkins)
|
||||
[](https://goreportcard.com/report/github.com/appleboy/drone-jenkins)
|
||||
|
||||
一个用于触发 [Jenkins](https://jenkins.io/) 任务的 [Drone](https://github.com/drone/drone) 插件,支持灵活的认证方式与参数传递。
|
||||
一个用于触发 [Jenkins](https://jenkins.io/) 任务的 CLI 工具与 CI/CD 插件。支持 [GitHub Actions](https://github.com/features/actions)、[GitLab CI](https://docs.gitlab.com/ee/ci/)、[Gitea Action](https://docs.gitea.com/usage/actions/overview) 以及任何支持 Docker 容器或 Shell 命令的平台。
|
||||
|
||||
## 为什么选择 drone-jenkins?
|
||||
|
||||
在现代企业环境中,团队经常根据特定需求、项目要求或历史决策采用不同的 CI/CD 平台。常见的情况包括:
|
||||
|
||||
- **多个 CI 平台并存**:有些团队因为 Jenkins 丰富的插件生态系统而使用它,而其他团队则偏好 Drone 的简洁性和容器原生方式。
|
||||
- **多个 CI 平台并存**:有些团队因为 Jenkins 丰富的插件生态系统而使用它,而其他团队则偏好 GitHub Actions 或 GitLab CI 的简洁性和容器原生方式。
|
||||
- **遗留系统集成**:拥有既有 Jenkins 流水线的组织需要与新的 CI/CD 工作流程集成,而不需要重写所有内容。
|
||||
- **跨团队协作**:不同部门可能标准化使用不同的工具,需要平台之间的无缝沟通。
|
||||
|
||||
**drone-jenkins** 弥补了这个差距,让 CI/CD 流水线能够将触发 Jenkins 任务作为工作流程的一部分。虽然最初是为 Drone CI 设计的,但它可以与 **GitHub Actions**、**GitLab CI** 以及任何支持 Docker 容器或 Shell 命令的 CI 平台无缝协作。
|
||||
**drone-jenkins** 弥补了这个差距,让 CI/CD 流水线能够将触发 Jenkins 任务作为工作流程的一部分。它可以与 **GitHub Actions**、**GitLab CI**、**Gitea Action** 以及任何支持 Docker 容器或 Shell 命令的 CI 平台无缝协作。
|
||||
|
||||
这使得以下场景成为可能:
|
||||
|
||||
- **统一的部署流水线**:从任何 CI 平台触发现有的 Jenkins 部署任务,无需迁移
|
||||
- **渐进式迁移**:团队可以逐步迁移到现代 CI 平台,同时继续使用 Jenkins 任务
|
||||
- **两全其美**:使用 GitHub Actions 或 Drone 进行现代容器化构建,并使用 Jenkins 处理需要特定插件的专门任务
|
||||
- **两全其美**:使用 GitHub Actions 或 GitLab CI 进行现代容器化构建,并使用 Jenkins 处理需要特定插件的专门任务
|
||||
- **集中式编排**:从单一流水线协调跨多个 CI 系统的构建
|
||||
- **灵活使用**:提供 CLI 可执行文件、Docker 镜像或原生插件——根据您的工作流程选择使用方式
|
||||
- **灵活使用**:提供 CLI 可执行文件或 Docker 镜像——根据您的工作流程选择使用方式
|
||||
|
||||
无论您是在管理混合 CI/CD 环境还是编排复杂的多平台部署,drone-jenkins 都能提供您所需的连接能力。
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
- [使用方式](#使用方式)
|
||||
- [命令行](#命令行)
|
||||
- [Docker](#docker)
|
||||
- [Drone CI](#drone-ci)
|
||||
- [开发](#开发)
|
||||
- [构建](#构建)
|
||||
- [测试](#测试)
|
||||
@@ -66,7 +65,7 @@
|
||||
- 调试模式,显示详细参数信息并安全遮蔽令牌
|
||||
- SSL/TLS 支持,可使用自定义 CA 证书(PEM 内容、文件路径或 URL)
|
||||
- 跨平台支持(Linux、macOS、Windows)
|
||||
- 提供可执行文件、Docker 镜像或 Drone 插件形式
|
||||
- 提供 CLI 可执行文件或 Docker 镜像
|
||||
|
||||
## 前置条件
|
||||
|
||||
@@ -359,107 +358,6 @@ docker run --rm \
|
||||
ghcr.io/appleboy/drone-jenkins
|
||||
```
|
||||
|
||||
### Drone CI
|
||||
|
||||
将插件添加到您的 `.drone.yml`:
|
||||
|
||||
```yaml
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: drone-jenkins-plugin
|
||||
```
|
||||
|
||||
**多个任务带参数:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job:
|
||||
- deploy-frontend
|
||||
- deploy-backend
|
||||
parameters: |
|
||||
ENVIRONMENT=production
|
||||
VERSION=${DRONE_TAG}
|
||||
COMMIT_SHA=${DRONE_COMMIT_SHA}
|
||||
BRANCH=${DRONE_BRANCH}
|
||||
```
|
||||
|
||||
**使用远程令牌:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
remote_token:
|
||||
from_secret: jenkins_remote_token
|
||||
job: my-jenkins-job
|
||||
```
|
||||
|
||||
**等待任务完成:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: deploy-production
|
||||
wait: true
|
||||
poll_interval: 15s
|
||||
timeout: 1h
|
||||
```
|
||||
|
||||
**使用调试模式:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: my-jenkins-job
|
||||
debug: true
|
||||
```
|
||||
|
||||
**使用自定义 CA 证书:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: https://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: my-jenkins-job
|
||||
ca_cert:
|
||||
from_secret: jenkins_ca_cert
|
||||
```
|
||||
|
||||
更多详细示例和高级配置,请参阅 [DOCS.md](DOCS.md)。
|
||||
|
||||
## 开发
|
||||
|
||||
+6
-108
@@ -10,25 +10,25 @@
|
||||
[](https://codecov.io/gh/appleboy/drone-jenkins)
|
||||
[](https://goreportcard.com/report/github.com/appleboy/drone-jenkins)
|
||||
|
||||
一個用於觸發 [Jenkins](https://jenkins.io/) 任務的 [Drone](https://github.com/drone/drone) 外掛,支援彈性的認證方式與參數傳遞。
|
||||
一個用於觸發 [Jenkins](https://jenkins.io/) 任務的 CLI 工具與 CI/CD 外掛。支援 [GitHub Actions](https://github.com/features/actions)、[GitLab CI](https://docs.gitlab.com/ee/ci/)、[Gitea Action](https://docs.gitea.com/usage/actions/overview) 以及任何支援 Docker 容器或 Shell 命令的平台。
|
||||
|
||||
## 為什麼選擇 drone-jenkins?
|
||||
|
||||
在現代企業環境中,團隊經常根據特定需求、專案要求或歷史決策採用不同的 CI/CD 平台。常見的情況包括:
|
||||
|
||||
- **多個 CI 平台並存**:有些團隊因為 Jenkins 豐富的外掛生態系統而使用它,而其他團隊則偏好 Drone 的簡潔性和容器原生方式。
|
||||
- **多個 CI 平台並存**:有些團隊因為 Jenkins 豐富的外掛生態系統而使用它,而其他團隊則偏好 GitHub Actions 或 GitLab CI 的簡潔性和容器原生方式。
|
||||
- **舊有系統整合**:擁有既有 Jenkins 流水線的組織需要與新的 CI/CD 工作流程整合,而不需要重寫所有內容。
|
||||
- **跨團隊協作**:不同部門可能標準化使用不同的工具,需要平台之間的無縫溝通。
|
||||
|
||||
**drone-jenkins** 彌補了這個差距,讓 CI/CD 流水線能夠將觸發 Jenkins 任務作為工作流程的一部分。雖然最初是為 Drone CI 設計的,但它可以與 **GitHub Actions**、**GitLab CI** 以及任何支援 Docker 容器或 Shell 命令的 CI 平台無縫協作。
|
||||
**drone-jenkins** 彌補了這個差距,讓 CI/CD 流水線能夠將觸發 Jenkins 任務作為工作流程的一部分。它可以與 **GitHub Actions**、**GitLab CI**、**Gitea Action** 以及任何支援 Docker 容器或 Shell 命令的 CI 平台無縫協作。
|
||||
|
||||
這使得以下情境成為可能:
|
||||
|
||||
- **統一的部署流水線**:從任何 CI 平台觸發現有的 Jenkins 部署任務,無需遷移
|
||||
- **漸進式遷移**:團隊可以逐步遷移到現代 CI 平台,同時繼續使用 Jenkins 任務
|
||||
- **兩全其美**:使用 GitHub Actions 或 Drone 進行現代容器化建置,並使用 Jenkins 處理需要特定外掛的專門任務
|
||||
- **兩全其美**:使用 GitHub Actions 或 GitLab CI 進行現代容器化建置,並使用 Jenkins 處理需要特定外掛的專門任務
|
||||
- **集中式協調**:從單一流水線協調跨多個 CI 系統的建置
|
||||
- **彈性使用**:提供 CLI 執行檔、Docker 映像檔或原生外掛——依照您的工作流程選擇使用方式
|
||||
- **彈性使用**:提供 CLI 執行檔或 Docker 映像檔——依照您的工作流程選擇使用方式
|
||||
|
||||
無論您是在管理混合 CI/CD 環境還是協調複雜的多平台部署,drone-jenkins 都能提供您所需的連接能力。
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
- [使用方式](#使用方式)
|
||||
- [命令列](#命令列)
|
||||
- [Docker](#docker)
|
||||
- [Drone CI](#drone-ci)
|
||||
- [開發](#開發)
|
||||
- [建置](#建置)
|
||||
- [測試](#測試)
|
||||
@@ -66,7 +65,7 @@
|
||||
- 除錯模式,顯示詳細參數資訊並安全遮蔽令牌
|
||||
- SSL/TLS 支援,可使用自訂 CA 憑證(PEM 內容、檔案路徑或 URL)
|
||||
- 跨平台支援(Linux、macOS、Windows)
|
||||
- 提供執行檔、Docker 映像檔或 Drone 外掛形式
|
||||
- 提供 CLI 執行檔或 Docker 映像檔
|
||||
|
||||
## 先決條件
|
||||
|
||||
@@ -359,107 +358,6 @@ docker run --rm \
|
||||
ghcr.io/appleboy/drone-jenkins
|
||||
```
|
||||
|
||||
### Drone CI
|
||||
|
||||
將外掛加入您的 `.drone.yml`:
|
||||
|
||||
```yaml
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: drone-jenkins-plugin
|
||||
```
|
||||
|
||||
**多個任務帶參數:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job:
|
||||
- deploy-frontend
|
||||
- deploy-backend
|
||||
parameters: |
|
||||
ENVIRONMENT=production
|
||||
VERSION=${DRONE_TAG}
|
||||
COMMIT_SHA=${DRONE_COMMIT_SHA}
|
||||
BRANCH=${DRONE_BRANCH}
|
||||
```
|
||||
|
||||
**使用遠端令牌:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
remote_token:
|
||||
from_secret: jenkins_remote_token
|
||||
job: my-jenkins-job
|
||||
```
|
||||
|
||||
**等待任務完成:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: deploy-production
|
||||
wait: true
|
||||
poll_interval: 15s
|
||||
timeout: 1h
|
||||
```
|
||||
|
||||
**使用除錯模式:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: http://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: my-jenkins-job
|
||||
debug: true
|
||||
```
|
||||
|
||||
**使用自訂 CA 憑證:**
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: trigger-jenkins
|
||||
image: ghcr.io/appleboy/drone-jenkins
|
||||
settings:
|
||||
url: https://jenkins.example.com/
|
||||
user: appleboy
|
||||
token:
|
||||
from_secret: jenkins_token
|
||||
job: my-jenkins-job
|
||||
ca_cert:
|
||||
from_secret: jenkins_ca_cert
|
||||
```
|
||||
|
||||
更多詳細範例和進階設定,請參閱 [DOCS.md](DOCS.md)。
|
||||
|
||||
## 開發
|
||||
|
||||
Reference in New Issue
Block a user