fastpastebin/.drone.yml

59 lines
1.2 KiB
YAML

---
kind: pipeline
type: docker
name: lint and test
steps:
- name: lint
image: code.pztrn.name/containers/mirror/golangci/golangci-lint:v1.48.0
pull: if-not-exists
environment:
CGO_ENABLED: 0
commands:
- golangci-lint run
- name: test
image: code.pztrn.name/containers/mirror/golang:1.19.0-alpine
pull: if-not-exists
environment:
CGO_ENABLED: 0
commands:
- go test ./...
---
kind: pipeline
type: docker
name: build docker images
depends_on:
- "lint and test"
steps:
- name: build master image
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
pull: if-not-exists
privileged: true
when:
branch: ["master"]
settings:
registry: code.pztrn.name
username: drone
password:
from_secret: drone_secret
repo: code.pztrn.name/apps/fastpastebin
auto_tag: true
- name: build tagged image
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
pull: if-not-exists
privileged: true
when:
event: ["tag"]
settings:
registry: code.pztrn.name
username: drone
password:
from_secret: drone_secret
repo: code.pztrn.name/apps/fastpastebin
auto_tag: true