Skip to content

Commit

Permalink
GitLab and GitLab CI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Sep 5, 2019
1 parent 4045f08 commit 68e468b
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/content/assets/css/_tailwind.dev.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ p {
@apply list-decimal ml-8 mb-8;
}

.content img {
@apply mt-4 mb-5 border border-gray-300;
}

.btn {
@apply px-6 py-2 bg-blue-500 text-white no-underline rounded shadow mt-1 inline-block;
transition: transform .2s ease, background-color .2s ease !important;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/content/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and changing the git remote from ssh to https.

To disable the automatic configuration (if you have other requirements or want to do it yourself) use `deps ci --manual`.

For specifics on what is configured and how, you can [read the code here](https://github.com/dropseed/deps/blob/master/internal/runner/ci.go#L170).
For specifics on what is configured and how, you can [read the code here](https://github.com/dropseed/deps/search?l=Go&q=autoconfigure).

## Filtering by type

Expand Down
39 changes: 38 additions & 1 deletion docs/content/gitlab-ci.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
---
title: GitLab CI
description: Examples and instructions for setting up deps in GitLab CI
---

# GitLab CI

> Docs coming soon!
## 1. Create a pipeline schedule

You will need a `DEPS_TOKEN` from [3.dependencies.io](https://3.dependencies.io) and
a `DEPS_GITLAB_TOKEN` if you are running this on a [GitLab repo](/gitlab/).

[![GitLab pipeline schedule for deps](/assets/img/screenshots/gitlab-ci-pipeline-schedule.png)](/assets/img/screenshots/gitlab-ci-pipeline-schedule.png)

## 2. Add deps jobs to .gitlab-ci.yml

This example shows two different languages in use,
each running in their own container.

The `--type` option is used to run the specific language updates in their respective containers.

> Note: GitLab CI is supported by [CI autoconfigure](/ci/#autoconfigure).
A minimal example of using deps in `.gitlab-ci.yml` would look like this:

```yaml
deps-js:
image: "node:latest"
only: [schedules]
script:
- curl https://www.dependencies.io/install.sh | bash -s -- -b $HOME/bin
- $HOME/bin/deps ci --type js

deps-python:
image: "python:3"
only: [schedules]
script:
- curl https://www.dependencies.io/install.sh | bash -s -- -b $HOME/bin
- $HOME/bin/deps ci --type python
```
42 changes: 41 additions & 1 deletion docs/content/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,44 @@ description: "Examples and instructions for setting up deps in GitLab"

# GitLab

> Docs coming soon!
The standard way to give deps access to your repo is with a *personal access token*.
You can use your personal account to do this, or a "bot" account that your team has.

1. Log in with the account you want deps to use (this will be the author of deps pull requests)
1. Give it access to the repo you're setting up
1. [Generate a new token](https://gitlab.com/profile/personal_access_tokens) with the `write_repository` and `api` scopes
[![GitLab personal access token settings for deps](/assets/img/screenshots/gitlab-personal-access-token.png)](/assets/img/screenshots/gitlab-personal-access-token.png)
1. Set the required environment variables in your CI
- `GITLAB_TOKEN` or `DEPS_GITLAB_TOKEN`

## Merge request settings

When working with a GitLab repo,
there are a few settings you can use to determine what your MRs look like.

```yaml
version: 3
dependencies:
- type: python
settings:
gitlab_target_branch: "dev"
gitlab_labels: ["automerge"]
gitlab_assignee_id: 1
gitlab_assignee_ids: [1, 2]
gitlab_target_project_id: 1
gitlab_milestone_id: 1
gitlab_remove_source_branch: true
gitlab_allow_collaboration: true
gitlab_allow_maintainer_to_push: true
gitlab_squash: true
```
If you don't need a `deps.yml` then you can also configure these settings via environment variables.
This is an easy way to put settings directly in your CI config.

Note that they'll need to be in the format of a JSON-encoded string,
with an uppercase name prefixed by `DEPS_SETTING_`.

```sh
$ DEPS_SETTING_GITLAB_LABELS='["automerge"]' deps ci
```

0 comments on commit 68e468b

Please sign in to comment.