cake_crm/.drone.yml

54 lines
1.0 KiB
YAML
Raw Normal View History

2024-05-19 10:02:50 +00:00
kind: pipeline
type: docker
name: default
steps:
- name: build
image: golang
commands:
2024-05-19 10:40:45 +00:00
- go build GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o cake_crm cmd/cake_crm/main.go
2024-05-19 10:02:50 +00:00
- name: test
image: golang
commands:
2024-05-19 10:16:32 +00:00
- go test ./...
2024-05-19 10:02:50 +00:00
- name: scp
image: appleboy/drone-scp
settings:
host:
from_secret: server_ip
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
target:
- deploys/cake_crm
source:
- cake_crm
- docker-compose.yml
- Dockerfile
rm: true
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: server_ip
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
command_timeout: 10s
script:
- cd deploys/cake_crm
- docker-compose up -d --force-recreate
trigger:
event:
- push