This repository has been archived on 2022-05-04. You can view files and clone it, but cannot push or open issues or pull requests.
tso-sw/.drone.yml

214 lines
4.6 KiB
YAML
Raw Normal View History

2020-05-11 04:41:12 +02:00
---
kind: pipeline
name: test-set-default
platform:
arch: amd64
steps:
- name: reveal-env
pull: always
image: immawanderer/archlinux-rf:latest
volumes:
- name: shm
path: /dev/shm
commands:
- uname -r
- python --version
- robot --version || echo "rf loves to exit with code $(robot --version 2>&1 >/dev/null; echo $?)"
- mkdir -pv archives
- mkdir -pv results/${DRONE_STAGE_NAME}
- name: test00
pull: if-not-exists
image: immawanderer/archlinux-rf:latest
volumes:
- name: shm
path: /dev/shm
commands:
- mkdir -pv results/${DRONE_STAGE_NAME}/test00
- robot -T -d results/${DRONE_STAGE_NAME}/test00 test00.robot
when:
status:
- success
- failure
depends_on:
- reveal-env
- name: test01
pull: if-not-exists
image: immawanderer/archlinux-rf:latest
volumes:
- name: shm
path: /dev/shm
commands:
- mkdir -pv results/${DRONE_STAGE_NAME}/test01
- robot -T -d results/${DRONE_STAGE_NAME}/test01 test01.robot
when:
status:
- success
- failure
depends_on:
- reveal-env
2020-05-11 04:41:12 +02:00
- name: copy-cache
pull: if-not-exists
image: immawanderer/archlinux-rf:latest
volumes:
- name: shm
path: /dev/shm
- name: cache
path: /run/cache
commands:
- cp -vR results /run/cache/results-${DRONE_COMMIT_SHA}
when:
status:
- success
- failure
depends_on:
2020-05-11 05:01:40 +02:00
- test01
2020-05-11 04:41:12 +02:00
volumes:
- name: cache
host:
path: /run/cache
---
kind: pipeline
name: archive
platform:
os: linux
arch: amd64
trigger:
branch:
- master
- dev
event:
- push
- tag
status:
- success
- failure
depends_on:
- test-set-default
clone:
disable: true
steps:
- name: tar-zstd-gpg
pull: if-not-exists
image: immawanderer/archlinux-rf:latest
volumes:
- name: shm
path: /dev/shm
- name: cache
path: /run/cache
commands:
- mkdir -pv archives
- ( cd /run/cache; tar cfv /drone/src/archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd results-${DRONE_COMMIT_SHA} --zstd )
2020-05-11 04:41:12 +02:00
- curl -sS https://dotya.ml/store/0x28bd2388.asc | gpg --quiet --import -
- gpg -eR 28bd2388 --trust-model always archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd
- sha512sum archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg > archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg-SHA512SUM
- rm archives/*zstd
- cp -vR archives /run/cache
- rm -r /run/cache/results-${DRONE_COMMIT_SHA}
when:
status:
- success
- failure
volumes:
- name: cache
host:
path: /run/cache
---
kind: pipeline
name: upload
platform:
os: linux
arch: amd64
clone:
disable: true
trigger:
branch:
- master
- dev
event:
- push
- tag
status:
- success
- failure
depends_on:
- archive
steps:
- name: backblaze-b2
pull: always
image: immawanderer/archlinux-rf:latest
volumes:
- name: cache
path: /run/cache
environment:
B2_BUCKET_NAME:
from_secret: B2_BUCKET_NAME
B2_KEY_ID:
from_secret: B2_KEY_ID
B2_KEY:
from_secret: B2_KEY
commands:
- b2 authorize-account $B2_KEY_ID $B2_KEY
- ( cd /run/cache/archives; b2 upload-file --contentType 'text/plain' "$B2_BUCKET_NAME" "results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg-SHA512SUM" "results/results-$(date +%Y-%m-%dT%H-%M)-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg-SHA512SUM" > /dev/null 2>&1 )
- ( cd /run/cache/archives; b2 upload-file --contentType 'application/zstd' "$B2_BUCKET_NAME" "results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg" "results/results-$(date +%Y-%m-%dT%H-%M)-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg" > /dev/null 2>&1 )
2020-05-11 04:41:12 +02:00
volumes:
- name: cache
host:
path: /run/cache
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
clone:
disable: true
trigger:
branch:
- master
- dev
event:
- push
- tag
status:
- success
- failure
depends_on:
- test-set-default
steps:
- name: discord
pull: always
image: appleboy/drone-discord:1.2.4
settings:
message: "{{#success build.status}} ✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.\nevent: **`{{build.event}}`**\ncommit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`\n```{{commit.message}}``` {{else}} ❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.\nevent: **`${DRONE_BUILD_EVENT}`**\ncommit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`\n```{{commit.message}}``` {{/success}}\n"
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token