2021-08-08 10:37:18 +02:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
image: golang
|
|
|
|
commands:
|
2021-08-14 20:20:44 +02:00
|
|
|
- CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' .
|
2021-08-08 10:37:18 +02:00
|
|
|
- go test ./...
|
|
|
|
|
|
|
|
- name: publish
|
2021-08-15 00:47:02 +02:00
|
|
|
image: docker:20
|
|
|
|
environment:
|
2021-08-08 10:37:18 +02:00
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
2021-08-15 00:47:02 +02:00
|
|
|
commands:
|
|
|
|
- docker login -u $username --password $password
|
|
|
|
- docker build --tag drone-yaml-server:latest $PWD
|
|
|
|
- docker push drone-yaml-server:latest
|