84 lines
1.5 KiB
YAML
84 lines
1.5 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
environment:
|
|
CGO_ENABLED: 0
|
|
|
|
steps:
|
|
- name: test
|
|
image: golang:latest
|
|
volumes:
|
|
- name: modules
|
|
path: /go/pkg/mod
|
|
commands:
|
|
- make check
|
|
|
|
- name: build
|
|
image: golang:latest
|
|
volumes:
|
|
- name: modules
|
|
path: /go/pkg/mod
|
|
commands:
|
|
- make
|
|
depends_on:
|
|
- test
|
|
|
|
- name: stop-service
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host:
|
|
from_secret: SSH_HOST
|
|
username: root
|
|
key:
|
|
from_secret: SSH_PRIVATE_KEY
|
|
script:
|
|
- "systemctl stop indieauth"
|
|
depends_on:
|
|
- build
|
|
when:
|
|
branch:
|
|
- 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:
|
|
- name: modules
|
|
temp: {}
|