👷 Update and format Drone CI config
This commit is contained in:
parent
ada30fffcd
commit
e89095a9dc
|
@ -1,83 +1,49 @@
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: "pipeline"
|
||||||
type: docker
|
type: "docker"
|
||||||
name: default
|
name: "default"
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: "test"
|
||||||
image: golang:latest
|
image: "golang:1.20"
|
||||||
volumes:
|
volumes:
|
||||||
- name: modules
|
- name: "modules"
|
||||||
path: /go/pkg/mod
|
path: "/go/pkg/mod"
|
||||||
commands:
|
commands:
|
||||||
- make check
|
- "make check"
|
||||||
|
|
||||||
- name: build
|
- name: "build"
|
||||||
image: golang:latest
|
image: "golang:1.20"
|
||||||
volumes:
|
volumes:
|
||||||
- name: modules
|
- name: "modules"
|
||||||
path: /go/pkg/mod
|
path: "/go/pkg/mod"
|
||||||
commands:
|
commands:
|
||||||
- make
|
- "make"
|
||||||
depends_on:
|
depends_on:
|
||||||
- test
|
- "test"
|
||||||
|
|
||||||
- name: stop-service
|
- name: "delivery"
|
||||||
image: appleboy/drone-ssh
|
image: "drillster/drone-rsync"
|
||||||
settings:
|
settings:
|
||||||
host:
|
hosts:
|
||||||
from_secret: SSH_HOST
|
from_secret: "SSH_HOST_IP"
|
||||||
username: root
|
|
||||||
key:
|
key:
|
||||||
from_secret: SSH_PRIVATE_KEY
|
from_secret: "SSH_PRIVATE_KEY"
|
||||||
|
source: "./auth"
|
||||||
|
target: "/etc/auth/auth"
|
||||||
|
prescript:
|
||||||
|
- "systemctl stop auth"
|
||||||
script:
|
script:
|
||||||
- "systemctl stop indieauth"
|
- "systemctl start auth"
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
- name: delivery
|
|
||||||
image: appleboy/drone-scp
|
|
||||||
settings:
|
|
||||||
host:
|
|
||||||
from_secret: SSH_HOST
|
|
||||||
username: root
|
|
||||||
password: ""
|
|
||||||
key:
|
|
||||||
from_secret: SSH_PRIVATE_KEY
|
|
||||||
target: "/root/indieauth"
|
|
||||||
source:
|
|
||||||
- "indieauth"
|
|
||||||
overwrite: true
|
|
||||||
# NOTE(toby3d): Just run a previous version of the instance if it failed to deliver the current one.
|
|
||||||
failure: ignore
|
|
||||||
depends_on:
|
|
||||||
- stop-service
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
- name: start-service
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
settings:
|
|
||||||
host:
|
|
||||||
from_secret: SSH_HOST
|
|
||||||
username: root
|
|
||||||
key:
|
|
||||||
from_secret: SSH_PRIVATE_KEY
|
|
||||||
script:
|
|
||||||
- "systemctl start indieauth"
|
|
||||||
depends_on:
|
|
||||||
- delivery
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: modules
|
- name: modules
|
||||||
temp: {}
|
temp: {}
|
||||||
|
|
Loading…
Reference in New Issue