2021-05-10 12:47:48 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: tags
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
|
|
|
- name: lint
|
2021-05-10 13:25:45 +02:00
|
|
|
image: golangci/golangci-lint:v1.39.0
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
|
|
|
- make install-tools
|
|
|
|
- make lint
|
|
|
|
depends_on:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
- name: test
|
2021-06-01 14:25:37 +02:00
|
|
|
image: golang:1.16
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
environment:
|
|
|
|
RASPBIAN_IMAGE: /tmp/2021-05-07-raspios-buster-armhf-lite.img
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
2021-06-01 14:25:37 +02:00
|
|
|
- apt update
|
|
|
|
- apt install -y multipath-tools unzip
|
2021-06-01 14:53:43 +02:00
|
|
|
- (cd /tmp; wget -4 https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-05-28/2021-05-07-raspios-buster-armhf-lite.zip)
|
2021-06-01 14:25:37 +02:00
|
|
|
- (cd /tmp; unzip 2021-05-07-raspios-buster-armhf-lite.zip)
|
|
|
|
- make build-image
|
|
|
|
- make test-all
|
2021-05-10 12:47:48 +02:00
|
|
|
depends_on:
|
|
|
|
- tags
|
2021-06-01 14:25:37 +02:00
|
|
|
- lint
|
2021-06-01 15:12:44 +02:00
|
|
|
- docker
|
2021-05-10 12:47:48 +02:00
|
|
|
|
|
|
|
- name: build
|
|
|
|
image: goreleaser/goreleaser:v0.162.0
|
|
|
|
commands:
|
|
|
|
- make build
|
|
|
|
depends_on:
|
|
|
|
- tags
|
|
|
|
- lint
|
|
|
|
- test
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
- name: release
|
|
|
|
image: goreleaser/goreleaser:v0.162.0
|
2021-05-10 13:14:15 +02:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
2021-05-10 12:47:48 +02:00
|
|
|
environment:
|
|
|
|
GITHUB_TOKEN:
|
|
|
|
from_secret: github_token
|
2021-05-10 13:14:15 +02:00
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: docker_username
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: github_token
|
|
|
|
DOCKER_REGISTRY: ghcr.io
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
2021-05-10 13:14:15 +02:00
|
|
|
- sleep 5
|
|
|
|
- >
|
|
|
|
echo $DOCKER_PASSWORD |
|
|
|
|
docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin
|
2021-05-10 12:47:48 +02:00
|
|
|
- goreleaser release --rm-dist
|
|
|
|
depends_on:
|
|
|
|
- tags
|
|
|
|
- lint
|
|
|
|
- test
|
2021-05-10 13:25:45 +02:00
|
|
|
- docker
|
2021-05-10 12:47:48 +02:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2021-05-10 13:14:15 +02:00
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|