2019-10-12 14:26:46 +05:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2022-06-26 22:08:23 +05:00
|
|
|
name: lint and test
|
2019-10-12 14:26:46 +05:00
|
|
|
|
|
|
|
steps:
|
2019-10-13 14:02:33 +05:00
|
|
|
- name: lint
|
2022-06-28 21:19:35 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/golangci/golangci-lint:v1.46.2
|
2022-06-26 22:49:37 +05:00
|
|
|
pull: if-not-exists
|
2019-10-13 14:02:33 +05:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
commands:
|
|
|
|
- golangci-lint run
|
|
|
|
|
|
|
|
- name: test
|
2022-06-28 21:19:35 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/golang:1.18.3-alpine
|
2022-06-26 22:49:37 +05:00
|
|
|
pull: if-not-exists
|
2019-10-13 14:02:33 +05:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
commands:
|
|
|
|
- go test ./...
|
|
|
|
|
2022-06-26 22:08:23 +05:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build docker images
|
|
|
|
|
2022-06-26 22:10:53 +05:00
|
|
|
depends_on:
|
|
|
|
- "lint and test"
|
|
|
|
|
2022-06-26 22:08:23 +05:00
|
|
|
steps:
|
|
|
|
- name: build master image
|
2022-06-28 21:38:09 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
|
2022-06-28 21:44:23 +05:00
|
|
|
pull: if-not-exists
|
|
|
|
privileged: true
|
2019-10-13 14:02:33 +05:00
|
|
|
when:
|
2021-11-20 22:19:58 +05:00
|
|
|
branch: ["master"]
|
2022-06-26 22:08:23 +05:00
|
|
|
settings:
|
|
|
|
registry: code.pztrn.name
|
|
|
|
username: drone
|
|
|
|
password:
|
|
|
|
from_secret: drone_secret
|
2022-06-26 22:49:37 +05:00
|
|
|
repo: code.pztrn.name/apps/fastpastebin
|
2022-06-26 22:08:23 +05:00
|
|
|
auto_tag: true
|
|
|
|
|
|
|
|
- name: build tagged image
|
2022-06-28 21:38:09 +05:00
|
|
|
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
|
2022-06-26 22:49:37 +05:00
|
|
|
pull: if-not-exists
|
2022-06-28 21:44:23 +05:00
|
|
|
privileged: true
|
2022-06-26 22:08:23 +05:00
|
|
|
when:
|
2022-06-26 22:04:03 +05:00
|
|
|
event: ["tag"]
|
2019-10-12 14:26:46 +05:00
|
|
|
settings:
|
2022-06-26 22:04:03 +05:00
|
|
|
registry: code.pztrn.name
|
|
|
|
username: drone
|
2019-10-12 14:26:46 +05:00
|
|
|
password:
|
2022-06-26 22:04:03 +05:00
|
|
|
from_secret: drone_secret
|
2022-06-26 22:49:37 +05:00
|
|
|
repo: code.pztrn.name/apps/fastpastebin
|
2019-10-12 14:26:46 +05:00
|
|
|
auto_tag: true
|