2020-03-02 20:30:25 +01:00
|
|
|
---
|
2020-02-28 00:54:16 +01:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2020-07-09 09:38:50 +02:00
|
|
|
name: 'build and deploy'
|
2020-02-28 00:54:16 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: hugo-extended
|
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:
|
|
|
|
- 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
|
|
|
|
pull: always
|
|
|
|
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 09:55:10 +02:00
|
|
|
OL_K:
|
|
|
|
from_secret: hugo_k
|
2020-07-09 09:58:23 +02:00
|
|
|
OL_K_PUB:
|
|
|
|
from_secret: hugo_k_pub
|
2020-07-09 09:38:50 +02:00
|
|
|
OL_D:
|
|
|
|
from_secret: hugo_dir
|
|
|
|
commands:
|
2020-07-09 09:55:10 +02:00
|
|
|
- echo $OL_K > ol_k
|
2020-07-09 09:58:23 +02:00
|
|
|
- echo $OL_K_PUB > ol_k.pub
|
2020-07-09 09:55:10 +02:00
|
|
|
- chmod -v 0600 ./ol_k
|
2020-07-09 09:58:23 +02:00
|
|
|
- chmod -v 0644 ./ol_k.pub
|
2020-07-09 09:55:10 +02:00
|
|
|
- rsync --rsh="ssh -i ./ol_k -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -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:
|
|
|
|
branch:
|
2020-07-09 09:38:50 +02:00
|
|
|
- master
|
|
|
|
- "dev*"
|
2020-03-02 20:25:56 +01:00
|
|
|
event:
|
2020-07-09 09:38:50 +02:00
|
|
|
- push
|
|
|
|
- tag
|
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: >
|
|
|
|
{{#success build.status}}
|
|
|
|
✅ [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-07-09 09:46:43 +02:00
|
|
|
failed step(s): **`${DRONE_FAILED_STEPS}`**
|
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
|
2020-04-22 11:41:28 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
2020-07-09 09:38:50 +02:00
|
|
|
name: notifications-cron
|
2020-04-22 11:41:28 +02:00
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
2020-07-09 09:38:50 +02:00
|
|
|
- cron
|
2020-04-22 11:41:28 +02:00
|
|
|
cron:
|
2020-07-09 09:38:50 +02:00
|
|
|
- hourly
|
|
|
|
- hourly-build
|
2020-04-22 11:41:28 +02:00
|
|
|
status:
|
2020-07-09 09:38:50 +02:00
|
|
|
- success
|
|
|
|
- failure
|
2020-04-22 11:41:28 +02:00
|
|
|
|
|
|
|
depends_on:
|
2020-07-09 09:38:50 +02:00
|
|
|
- 'build and deploy'
|
2020-04-22 11:41:28 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: discord
|
|
|
|
pull: always
|
2020-04-22 11:57:51 +02:00
|
|
|
image: appleboy/drone-discord:latest
|
2020-04-22 11:41:28 +02:00
|
|
|
settings:
|
2020-06-10 15:15:42 +02:00
|
|
|
message: >
|
|
|
|
{{#success build.status}}
|
|
|
|
✅ [Hourly 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}}
|
|
|
|
❌ [Hourly 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-07-09 09:46:43 +02:00
|
|
|
failed step(s): **`${DRONE_FAILED_STEPS}`**
|
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-04-22 11:41:28 +02:00
|
|
|
webhook_id:
|
|
|
|
from_secret: discord_webhook_hourly_id
|
|
|
|
webhook_token:
|
|
|
|
from_secret: discord_webhook_hourly_token
|