2024-11-09 15:58:14 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
image: golang:1.23
|
|
|
|
commands:
|
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o smm_core cmd/smm_core/main.go
|
|
|
|
|
|
|
|
- name: test
|
|
|
|
image: golang:1.23
|
|
|
|
commands:
|
|
|
|
- go test ./...
|
|
|
|
|
|
|
|
- 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/smm_core
|
|
|
|
source:
|
|
|
|
- resources
|
|
|
|
- smm_core
|
|
|
|
- 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
|
2024-11-09 16:31:06 +00:00
|
|
|
command_timeout: 50s
|
2024-11-09 15:58:14 +00:00
|
|
|
script:
|
|
|
|
- cd deploys/smm_core
|
|
|
|
- docker-compose up -d --build --force-recreate
|
|
|
|
|
|
|
|
trigger:
|
2024-11-09 16:14:08 +00:00
|
|
|
branch:
|
|
|
|
- master
|
2024-11-09 15:58:14 +00:00
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
|
|
|
|