Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update Drone CI integration #2789

Merged
merged 1 commit into from Dec 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 49 additions & 7 deletions www/docs/ci/drone.md
Expand Up @@ -23,30 +23,72 @@ steps:

- name: test
image: golang
volumes:
- name: deps
path: /go
commands:
- go test -race -v ./... -cover

- name: release
image: goreleaser/goreleaser
environment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- goreleaser release
when:
event: tag
```

In case you need to build docker image, use [Docker-In-Docker](https://docs.drone.io/pipeline/docker/examples/services/docker_dind/) (DIND)

```yaml
---
kind: pipeline
name: default
trigger:
ref:
- refs/tags/*

services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run

steps:
- name: fetch
image: docker:git
commands:
- git fetch --tags

- name: test
image: golang
commands:
- go test -race -v ./... -cover

- name: release
image: goreleaser/goreleaser
environment:
GITHUB_TOKEN:
from_secret: github_token
volumes:
- name: deps
path: /go
- name: dockersock
path: /var/run
commands:
- curl -sL https://git.io/goreleaser | bash
- goreleaser release
when:
event: tag

volumes:
- name: deps
- name: dockersock
temp: {}
```

Note: to use DIND you have to set repo as 'trusted'. To mark repository as trusted:

1. contact your Drone's admin
2. or set your [user as administrator](https://docs.drone.io/server/user/admin/) and then enable 'trusted' switch in repository settings UI

#### 0.8
```yaml
pipeline:
Expand Down