ev/.drone.yml

52 lines
818 B
YAML
Raw Normal View History

2023-05-29 09:32:25 -06:00
kind: pipeline
type: docker
2023-05-29 10:16:58 -06:00
name: build
2023-05-29 09:32:25 -06:00
steps:
- name: test
image: golang:1.20
commands:
2023-05-29 10:23:50 -06:00
- go test -v -race -skip '^TestE2E|TestMain' ./...
2023-05-29 10:10:38 -06:00
2023-05-29 10:31:09 -06:00
trigger:
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: deploy
steps:
2023-05-29 10:16:58 -06:00
- name: build
image: golang:1.20
environment:
GOOS: linux
GOARCH: amd64
commands:
- go build -ldflags "-s -w" -o build/ev ./cmd/ev
2023-05-29 10:20:33 -06:00
- name: compress
image: gruebel/upx:latest
commands:
2023-05-29 10:56:01 -06:00
- upx --best --lzma -o .ansible/ev build/ev
2023-05-29 10:20:33 -06:00
2023-05-29 10:10:38 -06:00
- name: deploy
image: plugins/ansible:3
settings:
playbook: .ansible/playbook.yml
inventory: .ansible/inventory
become: true
become_method: sudo
2023-05-29 10:32:33 -06:00
ssh_common_args: -p 65535
2023-05-29 10:10:38 -06:00
user: deploy
private_key:
2023-05-29 10:16:58 -06:00
from_secret: drone_ssh
trigger:
event:
- promote
target:
2023-05-29 10:31:09 -06:00
- production