2021-11-21 14:12:09 +05:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: lint
|
2022-06-29 00:41:56 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/golangci/golangci-lint:v1.46.2
|
2021-11-21 14:12:09 +05:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
commands:
|
|
|
|
- golangci-lint run
|
|
|
|
|
|
|
|
- name: test
|
2022-06-29 00:41:56 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/golang:1.18.3-alpine
|
2021-11-21 14:12:09 +05:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
commands:
|
|
|
|
- go test ./...
|
|
|
|
|
2022-06-30 14:14:40 +05:00
|
|
|
- name: build master image
|
2022-06-29 00:41:56 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
|
2021-11-21 14:12:09 +05:00
|
|
|
when:
|
|
|
|
branch: ["master"]
|
|
|
|
settings:
|
2022-06-29 00:41:56 +05:00
|
|
|
registry: code.pztrn.name
|
|
|
|
username: drone
|
2021-11-21 14:12:09 +05:00
|
|
|
password:
|
2022-06-29 00:41:56 +05:00
|
|
|
from_secret: drone_secret
|
|
|
|
repo: code.pztrn.name/apps/metricator
|
2021-11-21 14:12:09 +05:00
|
|
|
auto_tag: true
|
2022-06-30 14:14:40 +05:00
|
|
|
|
|
|
|
- name: build tagged image
|
|
|
|
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
|
|
|
|
when:
|
|
|
|
event: ["tag"]
|
|
|
|
settings:
|
|
|
|
registry: code.pztrn.name
|
|
|
|
username: drone
|
|
|
|
password:
|
|
|
|
from_secret: drone_secret
|
|
|
|
repo: code.pztrn.name/apps/metricator
|
|
|
|
auto_tag: true
|