2020-03-02 20:30:25 +01:00
|
|
|
---
|
2020-02-28 00:54:16 +01:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2020-07-13 16:30:09 +02:00
|
|
|
name: pull
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
2020-02-27 16:42:22 +01:00
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- "test*"
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
2020-02-28 00:54:16 +01:00
|
|
|
steps:
|
2020-07-13 16:34:10 +02:00
|
|
|
- name: fedora-hugo
|
2020-03-03 22:33:04 +01:00
|
|
|
pull: always
|
2020-06-07 15:44:57 +02:00
|
|
|
image: immawanderer/fedora-hugo:latest
|
2020-02-28 00:54:16 +01:00
|
|
|
commands:
|
2020-07-13 15:52:30 +02:00
|
|
|
- uname -r
|
|
|
|
- cat /etc/fedora-release
|
|
|
|
|
2020-07-13 16:34:10 +02:00
|
|
|
- name: alpine-rsync
|
|
|
|
pull: always
|
|
|
|
image: immawanderer/alpine-rsync:latest
|
|
|
|
commands:
|
|
|
|
- uname -r
|
|
|
|
|
|
|
|
|
2020-07-13 16:30:09 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: 'build and deploy'
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- pull
|
|
|
|
|
|
|
|
steps:
|
2020-07-13 15:52:30 +02:00
|
|
|
- name: hugo-extended
|
|
|
|
pull: if-not-exists
|
|
|
|
image: immawanderer/fedora-hugo:latest
|
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- success
|
|
|
|
commands:
|
2020-02-28 00:54:16 +01:00
|
|
|
- git submodule init
|
|
|
|
- git submodule update
|
2020-03-02 01:03:14 +01:00
|
|
|
- hugo version
|
2020-03-08 05:11:26 +01:00
|
|
|
- hugo --gc=true --minify
|
2020-03-02 20:25:56 +01:00
|
|
|
|
2020-07-09 09:38:50 +02:00
|
|
|
- name: deploy
|
2020-07-13 16:34:10 +02:00
|
|
|
pull: if-not-exists
|
2020-07-09 09:38:50 +02:00
|
|
|
image: immawanderer/alpine-rsync:latest
|
2020-03-08 05:11:26 +01:00
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- success
|
2020-07-09 09:38:50 +02:00
|
|
|
depends_on:
|
|
|
|
- hugo-extended
|
|
|
|
environment:
|
|
|
|
OL:
|
|
|
|
from_secret: hugo_user
|
2020-07-09 10:58:17 +02:00
|
|
|
OL_P:
|
|
|
|
from_secret: hugo_passwd
|
2020-07-09 09:38:50 +02:00
|
|
|
OL_D:
|
2020-09-02 23:55:42 +02:00
|
|
|
from_secret: hugo_dir_t
|
2020-07-09 09:38:50 +02:00
|
|
|
commands:
|
2020-07-09 11:32:24 +02:00
|
|
|
- echo $OL_P > nupass
|
2020-07-09 11:37:24 +02:00
|
|
|
- export RSYNC_RSH='sshpass -f ./nupass ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
|
2020-09-02 23:55:42 +02:00
|
|
|
- rsync -av --delete --chown $OL public/ $OL@dotya.ml:$OL_D
|
2020-03-10 01:24:45 +01:00
|
|
|
|
|
|
|
|
2020-03-02 20:25:56 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: notifications
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
2020-07-09 09:38:50 +02:00
|
|
|
- push
|
2020-02-27 16:42:22 +01:00
|
|
|
- pull_request
|
2020-03-02 20:25:56 +01:00
|
|
|
status:
|
2020-07-09 09:38:50 +02:00
|
|
|
- success
|
|
|
|
- failure
|
2020-03-02 20:25:56 +01:00
|
|
|
|
|
|
|
depends_on:
|
2020-07-09 09:38:50 +02:00
|
|
|
- 'build and deploy'
|
2020-03-08 05:11:26 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: discord
|
2020-04-22 11:57:51 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
image: appleboy/drone-discord:latest
|
2020-03-08 05:11:26 +01:00
|
|
|
settings:
|
2020-06-10 15:15:42 +02:00
|
|
|
message: >
|
2020-07-09 12:51:43 +02:00
|
|
|
{{#success build.status}}
|
2020-06-10 15:15:42 +02:00
|
|
|
✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` has been successfully deployed.
|
|
|
|
event: **`{{build.event}}`**
|
|
|
|
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
|
|
|
{{else}}
|
|
|
|
❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed to deploy.
|
|
|
|
event: **`${DRONE_BUILD_EVENT}`**
|
2020-07-09 09:38:50 +02:00
|
|
|
failed stage(s): **`${DRONE_FAILED_STAGES}`**
|
2020-06-10 15:15:42 +02:00
|
|
|
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
2020-07-09 09:38:50 +02:00
|
|
|
```{{commit.message}}```
|
2020-06-10 15:15:42 +02:00
|
|
|
{{/success}}
|
2020-03-08 05:11:26 +01:00
|
|
|
webhook_id:
|
|
|
|
from_secret: discord_webhook_id
|
|
|
|
webhook_token:
|
|
|
|
from_secret: discord_webhook_token
|