Drone plugin for trigger gitlab-ci jobs.
See the detail documentation for Triggering pipelines through the API. How to get the token from a new trigger? You can add a new trigger by going to your project’s Settings ➔ CI/CD
under Triggers.
How to get the project ID? going to your project’s Settings ➔ General
under Gerneral project.
The pre-compiled binaries can be downloaded from release page. Support the following OS type.
- Windows amd64/386
- Linux amd64/386
- Darwin amd64/386
With Go
installed
go get -u -v github.com/appleboy/drone-gitlab-ci
or build the binary with the following command:
make build
Build the docker image with the following commands:
make docker
There are three ways to trigger gitlab-ci jobs.
trigger job.
drone-gitlab-ci \
--host https://gitlab.com/ \
--token XXXXXXXX \
--ref master \
--id gitlab-ci-project-id
Enable debug mode.
drone-gitlab-ci \
--host https://gitlab.com/ \
--token XXXXXXXX \
--ref master \
--id gitlab-ci-project-id
+ --debug
trigger job.
docker run --rm \
-e GITLAB_HOST=https://gitlab.com/
-e GITLAB_TOKEN=xxxxx
-e GITLAB_REF=master
-e GITLAB_ID=gitlab-ci-project-id
appleboy/drone-gitlab-ci
Enable debug mode.
docker run --rm \
-e GITLAB_HOST=https://gitlab.com/ \
-e GITLAB_TOKEN=xxxxx \
-e GITLAB_REF=master \
-e GITLAB_ID=gitlab-ci-project-id \
-e GITLAB_DEBUG=true \
appleboy/drone-gitlab-ci
Execute from the working directory:
docker run --rm \
-e PLUGIN_HOST=https://gitlab.com/ \
-e PLUGIN_TOKEN=xxxxx \
-e PLUGIN_REF=master \
-e PLUGIN_ID=gitlab-ci-project-id \
-e PLUGIN_DEBUG=true \
-v $(pwd):$(pwd) \
-w $(pwd) \
appleboy/drone-gitlab-ci
You can get more information about how to use scp plugin in drone.
Test the package with the following command:
make test