woodpecker/docs/setup/gitlab.md

44 lines
2.2 KiB
Markdown
Raw Normal View History

2015-08-09 03:51:12 +00:00
# Gitlab
2015-07-11 00:40:03 +00:00
> GitLab support is experimental and unstable due to high variation in GitLab configurations and versions. We highly recommend using [Gogs](https://github.com/gogits/gogs) as an alternative to GitLab.
2015-09-22 09:36:57 +00:00
Drone comes with built-in support for GitLab version 8.0 and higher. To enable Gitlab you should configure the Gitlab driver using the following environment variables:
2015-05-24 21:13:56 +00:00
2015-08-09 03:51:12 +00:00
```bash
2015-10-08 00:17:15 +00:00
REMOTE_DRIVER=gitlab
REMOTE_CONFIG=https://gitlab.hooli.com?client_id=${client_id}&client_secret=${client_secret}
2015-08-09 03:51:12 +00:00
```
2015-08-09 03:51:12 +00:00
## Gitlab configuration
The following is the standard URI connection scheme:
```
scheme://host[:port][?options]
2015-07-07 04:13:50 +00:00
```
2015-05-24 21:13:56 +00:00
2015-08-09 03:51:12 +00:00
The components of this string are:
* `scheme` server protocol `http` or `https`.
* `host` server address to connect to. The default value is github.com if not specified.
* `:port` optional. The default value is :80 if not specified.
* `?options` connection specific options.
## GitLab options
This section lists all connection options used in the connection string format. Connection options are pairs in the following form: `name=value`. The value is always case sensitive. Separate options with the ampersand (i.e. &) character:
* `client_id` oauth client id for registered application
* `client_secret` oauth client secret for registered application
* `open=false` allows users to self-register. Defaults to false for security reasons.
* `orgs=drone&orgs=docker` restricts access to these GitLab organizations. **Optional**
2015-08-09 03:51:12 +00:00
* `skip_verify=false` skip ca verification if self-signed certificate. Defaults to false for security reasons.
* `hide_archives=false` hide projects archived in GitLab from the listing.
* `clone_mode=token` a strategy for clone authorization, by default use repo token, but can be changed to `oauth` ( This is not secure, because your user token, with full access to your gitlab account will be written to .netrc, and it can be read by all who have access to project builds )
2015-08-09 03:51:12 +00:00
## Gitlab registration
2015-05-24 21:13:56 +00:00
2015-08-09 03:51:12 +00:00
You must register your application with GitLab in order to generate a Client and Secret. Navigate to your account settings and choose Applications from the menu, and click New Application.
2015-05-24 21:13:56 +00:00
2015-10-08 00:17:15 +00:00
Please use `http://drone.mycompany.com/authorize` as the Authorization callback URL.