2021-08-03 22:07:15 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2022-03-18 20:10:54 +00:00
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
2022-03-25 19:12:06 +00:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
2022-03-18 20:10:54 +00:00
|
|
|
|
2022-03-25 19:12:06 +00:00
|
|
|
steps:
|
2021-08-03 22:07:15 +00:00
|
|
|
- name: test
|
2023-01-16 09:00:24 +00:00
|
|
|
image: golang:latest
|
2021-08-03 22:07:15 +00:00
|
|
|
volumes:
|
2022-03-25 19:12:06 +00:00
|
|
|
- name: modules
|
|
|
|
path: /go/pkg/mod
|
2022-02-01 19:51:53 +00:00
|
|
|
commands:
|
2022-03-25 19:12:06 +00:00
|
|
|
- make check
|
2022-03-18 20:10:54 +00:00
|
|
|
|
2021-08-03 22:07:15 +00:00
|
|
|
- name: build
|
2023-01-16 09:00:24 +00:00
|
|
|
image: golang:latest
|
2021-08-03 22:07:15 +00:00
|
|
|
volumes:
|
2022-03-25 19:12:06 +00:00
|
|
|
- name: modules
|
|
|
|
path: /go/pkg/mod
|
2021-08-03 22:07:15 +00:00
|
|
|
commands:
|
2022-03-25 19:12:06 +00:00
|
|
|
- make
|
2021-08-03 22:07:15 +00:00
|
|
|
depends_on:
|
|
|
|
- test
|
2022-03-18 20:10:54 +00:00
|
|
|
|
2022-06-09 18:01:46 +00:00
|
|
|
- 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"
|
2022-03-25 19:12:06 +00:00
|
|
|
depends_on:
|
|
|
|
- build
|
2022-06-09 18:01:46 +00:00
|
|
|
when:
|
2022-06-10 09:48:39 +00:00
|
|
|
branch:
|
|
|
|
- master
|
2022-06-09 18:01:46 +00:00
|
|
|
|
|
|
|
- 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:
|
2022-06-10 09:48:39 +00:00
|
|
|
branch:
|
|
|
|
- master
|
2022-06-09 18:01:46 +00:00
|
|
|
|
|
|
|
- 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:
|
2022-06-10 09:48:39 +00:00
|
|
|
branch:
|
|
|
|
- master
|
2022-03-25 19:12:06 +00:00
|
|
|
|
2021-08-03 22:07:15 +00:00
|
|
|
volumes:
|
2022-03-25 19:12:06 +00:00
|
|
|
- name: modules
|
2022-02-01 19:51:53 +00:00
|
|
|
temp: {}
|