sshfwd/.drone.yml
xuu e5b7e04c39
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
Update '.drone.yml'
2023-05-29 12:39:17 -06:00

52 lines
796 B
YAML

kind: pipeline
type: docker
name: build
steps:
- name: test
image: golang:1.20
commands:
- go test -v -race ./...
trigger:
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: deploy
steps:
- name: build
image: golang:1.20
environment:
GOOS: linux
GOARCH: amd64
commands:
- go build -ldflags "-s -w" -o build/sshfwd .
- name: compress
image: gruebel/upx:latest
commands:
- upx --best --lzma -o .ansible/sshfwd build/sshfwd
- name: deploy
image: plugins/ansible:3
settings:
playbook: .ansible/playbook.yml
inventory: .ansible/inventory
become: true
become_method: sudo
ssh_common_args: -p 65535
user: deploy
private_key:
from_secret: drone_ssh
trigger:
event:
- promote
target:
- production