71 lines
1.1 KiB
YAML
71 lines
1.1 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: tests
|
|
|
|
steps:
|
|
- name: unit-test
|
|
image: golang
|
|
volumes:
|
|
- name: cache
|
|
path: /go
|
|
commands:
|
|
- go mod download
|
|
- go test -coverprofile=coverage.out -covermode=count ./...
|
|
- go tool cover -html=coverage.out -o coverage.html
|
|
- go tool cover -func=coverage.out | grep total
|
|
|
|
- name: race-test
|
|
image: golang
|
|
volumes:
|
|
- name: cache
|
|
path: /go
|
|
commands:
|
|
- go mod download
|
|
- go test -race -short ./...
|
|
|
|
volumes:
|
|
- name: cache
|
|
temp: {}
|
|
|
|
---
|
|
kind: pipeline
|
|
name: docker
|
|
|
|
steps:
|
|
- name: docker
|
|
image: plugins/docker
|
|
settings:
|
|
registry: docker.pkg.github.com
|
|
username: hamburghammer
|
|
password:
|
|
from_secret: DOCKER_REGISTRY_KEY
|
|
repo: docker.pkg.github.com/hamburghammer/gmon/gmon
|
|
auto_tag: true
|
|
|
|
depends_on:
|
|
- tests
|
|
|
|
---
|
|
kind: pipeline
|
|
name: deployment
|
|
|
|
steps:
|
|
- name: ssh commands
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host:
|
|
from_secret: SSH_HOST
|
|
username:
|
|
from_secret: SSH_USERNAME
|
|
password:
|
|
from_secret: SSH_PASSWORD
|
|
port:
|
|
from_secret: SSH_PORT
|
|
script:
|
|
- gmon_deployment.sh
|
|
|
|
trigger:
|
|
event:
|
|
- promote
|
|
target:
|
|
- production |