{"id":13582228,"url":"https://github.com/appleboy/drone-gitlab-ci","last_synced_at":"2026-02-17T02:23:57.233Z","repository":{"id":57560981,"uuid":"95345860","full_name":"appleboy/drone-gitlab-ci","owner":"appleboy","description":"Drone plugin for trigger gitlab-ci jobs.","archived":false,"fork":false,"pushed_at":"2024-12-17T14:24:54.000Z","size":1029,"stargazers_count":19,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T08:31:33.683Z","etag":null,"topics":["docker","drone-ci","drone-plugin","gitlab-ci","trigger"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-25T07:46:43.000Z","updated_at":"2025-02-11T12:50:25.000Z","dependencies_parsed_at":"2022-09-01T12:21:08.961Z","dependency_job_id":null,"html_url":"https://github.com/appleboy/drone-gitlab-ci","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-gitlab-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-gitlab-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-gitlab-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fdrone-gitlab-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/drone-gitlab-ci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248925470,"owners_count":21184256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","drone-ci","drone-plugin","gitlab-ci","trigger"],"created_at":"2024-08-01T15:02:30.572Z","updated_at":"2026-02-17T02:23:57.227Z","avatar_url":"https://github.com/appleboy.png","language":"Go","readme":"# drone-gitlab-ci\n\n![logo](./images/gitlab-ci.png)\n\n[繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md) | [English](./README.md)\n\n[![Lint and Testing](https://github.com/appleboy/drone-gitlab-ci/actions/workflows/testing.yml/badge.svg)](https://github.com/appleboy/drone-gitlab-ci/actions/workflows/testing.yml)\n[![Trivy Security Scan](https://github.com/appleboy/drone-gitlab-ci/actions/workflows/trivy.yml/badge.svg)](https://github.com/appleboy/drone-gitlab-ci/actions/workflows/trivy.yml)\n[![GoDoc](https://godoc.org/github.com/appleboy/drone-gitlab-ci?status.svg)](https://godoc.org/github.com/appleboy/drone-gitlab-ci)\n[![codecov](https://codecov.io/gh/appleboy/drone-gitlab-ci/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-gitlab-ci)\n[![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-gitlab-ci)](https://goreportcard.com/report/github.com/appleboy/drone-gitlab-ci)\n\n## What is drone-gitlab-ci?\n\n**drone-gitlab-ci** is a CLI tool and CI/CD plugin that triggers [GitLab CI](https://about.gitlab.com/solutions/continuous-integration/) pipelines from any environment. It serves as a bridge between different CI/CD platforms, enabling you to integrate GitLab CI into your existing workflows seamlessly.\n\n## Why use this?\n\nIn modern software development, teams often use multiple CI/CD platforms across different projects or services. This creates challenges when you need to:\n\n- **Cross-Platform Integration**: Trigger GitLab CI pipelines from other CI/CD systems (Drone, GitHub Actions, Jenkins, etc.)\n- **Microservices Orchestration**: Automatically trigger dependent service pipelines after deployment\n- **Unified Pipeline Management**: Centralize pipeline triggering logic across diverse infrastructure\n- **Hybrid Cloud Workflows**: Connect CI/CD processes across different platforms and environments\n\n```txt\n┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐\n│   Drone CI      │     │                  │     │                 │\n│   GitHub Actions│────▶│ drone-gitlab-ci  │────▶│   GitLab CI     │\n│   Jenkins       │     │                  │     │   Pipeline      │\n│   Local Dev     │     └──────────────────┘     └─────────────────┘\n└─────────────────┘\n```\n\n## Use Cases\n\n| Scenario                       | Description                                                          |\n| ------------------------------ | -------------------------------------------------------------------- |\n| **Drone CI → GitLab CI**       | Use as a Drone plugin to trigger GitLab pipelines after Drone builds |\n| **GitHub Actions → GitLab CI** | Trigger GitLab deployments from GitHub repositories                  |\n| **Jenkins → GitLab CI**        | Integrate GitLab CI into existing Jenkins workflows                  |\n| **Local Development**          | Manually trigger pipelines during development and testing            |\n| **Microservices**              | Service A deployment triggers Service B pipeline automatically       |\n\n## Features\n\n- Trigger GitLab CI pipelines via API\n- Pass custom variables to pipelines\n- Wait for pipeline completion with configurable timeout\n- Support for self-hosted GitLab instances\n- Cross-platform binary (Windows, Linux, macOS)\n- Docker image available\n- Native support for Drone CI, GitHub Actions, and other CI/CD platforms\n\n## Table of Contents\n\n- [drone-gitlab-ci](#drone-gitlab-ci)\n  - [What is drone-gitlab-ci?](#what-is-drone-gitlab-ci)\n  - [Why use this?](#why-use-this)\n  - [Use Cases](#use-cases)\n  - [Features](#features)\n  - [Table of Contents](#table-of-contents)\n  - [Quick Start](#quick-start)\n  - [Installation](#installation)\n    - [Download Pre-built Binaries](#download-pre-built-binaries)\n    - [Install with Go](#install-with-go)\n    - [Build from Source](#build-from-source)\n  - [Configuration](#configuration)\n    - [GitLab Setup](#gitlab-setup)\n      - [1. Create a Personal Access Token](#1-create-a-personal-access-token)\n      - [2. Get Your Project ID](#2-get-your-project-id)\n    - [Parameters](#parameters)\n  - [Usage](#usage)\n    - [Command Line](#command-line)\n    - [Docker](#docker)\n    - [Drone CI](#drone-ci)\n    - [GitHub Actions](#github-actions)\n  - [Development](#development)\n    - [Run Tests](#run-tests)\n    - [Build Binary](#build-binary)\n    - [Code Quality](#code-quality)\n  - [License](#license)\n\n## Quick Start\n\nTrigger a GitLab CI pipeline in 3 steps:\n\n```bash\n# 1. Download the binary (or use Docker)\ngo install github.com/appleboy/drone-gitlab-ci@latest\n\n# 2. Set your credentials\nexport GITLAB_TOKEN=your-gitlab-token\nexport GITLAB_PROJECT_ID=your-project-id\n\n# 3. Trigger the pipeline\ndrone-gitlab-ci --ref main\n```\n\n## Installation\n\n### Download Pre-built Binaries\n\nDownload from the [release page](https://github.com/appleboy/drone-gitlab-ci/releases). Supported platforms:\n\n- Windows (amd64/386)\n- Linux (amd64/386)\n- macOS (amd64/arm64)\n\n### Install with Go\n\n```bash\ngo install github.com/appleboy/drone-gitlab-ci@latest\n```\n\n### Build from Source\n\n```bash\ngit clone https://github.com/appleboy/drone-gitlab-ci.git\ncd drone-gitlab-ci\nmake build\n```\n\n## Configuration\n\n### GitLab Setup\n\n#### 1. Create a Personal Access Token\n\nYou need a GitLab token to authenticate API requests. See [GitLab Token Overview](https://docs.gitlab.com/ee/security/tokens/index.html#personal-access-tokens).\n\n1. Go to GitLab → User Settings → Access Tokens\n2. Create a token with `api` scope\n3. Save the token securely\n\n![token](./images/user_token.png)\n\n#### 2. Get Your Project ID\n\nFind your project ID in **Settings → General → General project settings**.\n\n![projectID](./images/projectID.png)\n\nFor more details, see [Pipeline trigger tokens API](https://docs.gitlab.com/ee/api/pipeline_triggers.html).\n\n### Parameters\n\n| Parameter  | Flag                 | Environment Variables                                     | Description                   | Required | Default              |\n| ---------- | -------------------- | --------------------------------------------------------- | ----------------------------- | -------- | -------------------- |\n| Host       | `--host`             | `GITLAB_HOST`, `PLUGIN_HOST`, `INPUT_HOST`                | GitLab instance URL           | No       | `https://gitlab.com` |\n| Token      | `--token`, `-t`      | `GITLAB_TOKEN`, `PLUGIN_TOKEN`, `INPUT_TOKEN`             | GitLab access token           | **Yes**  | -                    |\n| Project ID | `--project-id`, `-p` | `GITLAB_PROJECT_ID`, `PLUGIN_ID`, `INPUT_PROJECT_ID`      | GitLab project ID             | **Yes**  | -                    |\n| Ref        | `--ref`, `-r`        | `GITLAB_REF`, `PLUGIN_REF`, `INPUT_REF`                   | Branch or tag to trigger      | No       | `main`               |\n| Variables  | `--variables`        | `GITLAB_VARIABLES`, `PLUGIN_VARIABLES`, `INPUT_VARIABLES` | Variables to pass (KEY=VALUE) | No       | -                    |\n| Wait       | `--wait`, `-w`       | `GITLAB_WAIT`, `PLUGIN_WAIT`, `INPUT_WAIT`                | Wait for pipeline completion  | No       | `false`              |\n| Timeout    | `--timeout`          | `GITLAB_TIMEOUT`, `PLUGIN_TIMEOUT`, `INPUT_TIMEOUT`       | Timeout for waiting           | No       | `60m`                |\n| Interval   | `--interval`, `-i`   | `GITLAB_INTERVAL`, `PLUGIN_INTERVAL`, `INPUT_INTERVAL`    | Polling interval              | No       | `5s`                 |\n| Insecure   | `--insecure`, `-k`   | `GITLAB_INSECURE`, `PLUGIN_INSECURE`, `INPUT_INSECURE`    | Skip SSL verification         | No       | `false`              |\n| Debug      | `--debug`, `-d`      | `GITLAB_DEBUG`, `PLUGIN_DEBUG`, `INPUT_DEBUG`             | Enable debug output           | No       | `false`              |\n| GitHub     | `--github`           | `GITHUB_ACTIONS`, `PLUGIN_GITHUB`, `INPUT_GITHUB`         | Enable GitHub Actions output  | No       | `false`              |\n\n## Usage\n\n### Command Line\n\nBasic usage:\n\n```bash\ndrone-gitlab-ci \\\n  --host https://gitlab.com \\\n  --token your-token \\\n  --project-id 12345 \\\n  --ref main\n```\n\nWith variables and wait for completion:\n\n```bash\ndrone-gitlab-ci \\\n  --host https://gitlab.com \\\n  --token your-token \\\n  --project-id 12345 \\\n  --ref main \\\n  --variables \"DEPLOY_ENV=production\" \\\n  --variables \"VERSION=1.0.0\" \\\n  --wait \\\n  --timeout 30m\n```\n\nEnable debug mode:\n\n```bash\ndrone-gitlab-ci \\\n  --host https://gitlab.com \\\n  --token your-token \\\n  --project-id 12345 \\\n  --ref main \\\n  --debug\n```\n\n### Docker\n\nBasic usage:\n\n```bash\ndocker run --rm \\\n  -e GITLAB_HOST=https://gitlab.com \\\n  -e GITLAB_TOKEN=your-token \\\n  -e GITLAB_PROJECT_ID=12345 \\\n  -e GITLAB_REF=main \\\n  appleboy/drone-gitlab-ci\n```\n\nWith wait and debug:\n\n```bash\ndocker run --rm \\\n  -e GITLAB_HOST=https://gitlab.com \\\n  -e GITLAB_TOKEN=your-token \\\n  -e GITLAB_PROJECT_ID=12345 \\\n  -e GITLAB_REF=main \\\n  -e GITLAB_WAIT=true \\\n  -e GITLAB_DEBUG=true \\\n  appleboy/drone-gitlab-ci\n```\n\n### Drone CI\n\nAdd to your `.drone.yml`:\n\n```yaml\nkind: pipeline\nname: default\n\nsteps:\n  - name: trigger-gitlab\n    image: appleboy/drone-gitlab-ci\n    settings:\n      host: https://gitlab.com\n      token:\n        from_secret: gitlab_token\n      project_id: 12345\n      ref: main\n      wait: true\n      timeout: 30m\n      variables:\n        - DEPLOY_ENV=production\n        - VERSION=${DRONE_TAG}\n```\n\n### GitHub Actions\n\nCreate `.github/workflows/trigger-gitlab.yml`:\n\n```yaml\nname: Trigger GitLab CI\n\non:\n  push:\n    branches: [main]\n\njobs:\n  trigger:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Trigger GitLab Pipeline\n        uses: docker://appleboy/drone-gitlab-ci\n        with:\n          host: https://gitlab.com\n          token: ${{ secrets.GITLAB_TOKEN }}\n          project_id: 12345\n          ref: main\n          github: true\n          wait: true\n```\n\n## Development\n\n### Run Tests\n\n```bash\nmake test\n```\n\n### Build Binary\n\n```bash\nmake build\n```\n\n### Code Quality\n\n```bash\nmake lint\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fdrone-gitlab-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Fdrone-gitlab-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fdrone-gitlab-ci/lists"}