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: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:
|
|
|
|
- upx --best --lzma -o ev build/ev
|
|
|
|
|
2023-05-29 10:29:34 -06:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
2023-05-29 10:16:58 -06:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2023-05-29 10:29:34 -06:00
|
|
|
name: deploy
|
2023-05-29 10:16:58 -06:00
|
|
|
|
2023-05-29 10:17:53 -06:00
|
|
|
steps:
|
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
|
|
|
|
user: deploy
|
|
|
|
private_key:
|
2023-05-29 10:16:58 -06:00
|
|
|
from_secret: drone_ssh
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- lavana
|