Skip to content

buildkite-plugins/gitlab-status-buildkite-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitlab Status Buildkite Plugin Build status

A Buildkite plugin for setting the status on a GitLab commit (It's currently an MVP).

This plugin requires that the agent has a gitlab access token (personal, group, project or OAuth2) configured with api scope.

Example

The following pipeline just set the status to success

steps:
  - command: "echo 'OK'"
    key: "success"
    plugins:
      - gitlab-status#v1.2.0: ~

Configuration options

Required

Technically, there are no required options for this plugin to work. It is to note that defaults will cause failures in the following situations:

  • check-name: if the step does not have a key
  • token-var-name: if the access token is not available in the variable GITLAB_ACCESS_TOKEN
  • gitlab-host: if you are not using gitlab.com

Optional

api-token-var-name (string)

Name of the variable that contains the value of the gitlab access token to authenticate with its API. Default: GITLAB_ACCESS_TOKEN

check-name (string)

The name of the check status being reported.

If the step does not have a key, you have to provide a non-empty value or it will cause the step to fail.

curl-debug (boolean)

Whether to show the arguments for the curl command to execute (exluding the access token). Default: false

gitlab-host (string)

The host to communicate with gitlab. Should be the same as the one in BUILDKITE_REPO. Default: gitlab.com

Development

You can run existing development tools with the following commands:

  • tests: docker run --rm -ti -v "$PWD":/plugin buildkite/plugin-tester:v4.0.0
  • linter: docker run --rm -ti -v "$PWD":/plugin buildkite/plugin-linter --id gitlab-status
  • shellcheck: docker run -v "$PWD":/mnt --rm -ti koalaman/shellcheck:stable hooks/* lib/*