2020-12-03 12:07:03 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: fetch
|
|
|
|
image: docker:git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
|
|
|
- name: lint
|
2020-12-03 12:27:40 +01:00
|
|
|
image: golangci/golangci-lint:latest
|
2020-12-03 12:07:03 +01:00
|
|
|
commands:
|
|
|
|
- make lint
|
|
|
|
|
2020-12-09 08:17:23 +01:00
|
|
|
- name: build
|
|
|
|
image: goreleaser/goreleaser:latest
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
environment:
|
|
|
|
commands:
|
|
|
|
- goreleaser build --rm-dist --snapshot
|
2020-12-09 08:31:45 +01:00
|
|
|
when:
|
2020-12-09 08:17:23 +01:00
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- tag
|
|
|
|
depends_on:
|
|
|
|
- lint
|
|
|
|
|
2020-12-03 12:07:03 +01:00
|
|
|
- name: release
|
|
|
|
image: goreleaser/goreleaser:latest
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
environment:
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: gitea_token
|
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: docker_username
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: docker_password
|
|
|
|
DOCKER_REGISTRY: quay.io
|
|
|
|
commands:
|
|
|
|
- sleep 5
|
2020-12-09 08:17:23 +01:00
|
|
|
- >
|
|
|
|
echo $DOCKER_PASSWORD |
|
|
|
|
docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin
|
2020-12-03 12:07:03 +01:00
|
|
|
- goreleaser release
|
2020-12-09 08:31:45 +01:00
|
|
|
when:
|
2020-12-09 08:17:23 +01:00
|
|
|
event:
|
|
|
|
- tag
|
2020-12-03 12:35:23 +01:00
|
|
|
depends_on:
|
|
|
|
- lint
|
2020-12-03 12:07:03 +01:00
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|