rf-testing/.drone.yml
surtur 93600bceac
All checks were successful
continuous-integration/drone/push Build is passing
b2 util was included in the image in the meantime
2020-05-11 03:53:50 +02:00

186 lines
4.0 KiB
YAML

---
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: test000
pull: if-not-exists
image: immawanderer/archlinux-rf:latest
volumes:
- name: shm
path: /dev/shm
- name: cache
path: /run/cache
commands:
- mkdir -pv results/${DRONE_STAGE_NAME}/${DRONE_STEP_NAME}
- robot -T -d results/${DRONE_STAGE_NAME}/${DRONE_STEP_NAME} test000.robot
- cp -vR results /run/cache
when:
status:
- success
- failure
depends_on:
- reveal-env
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:
- ls -la . ; pwd
- mkdir -pv archives
- tar cfv archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd /run/cache/results --zstd
- 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
- ls -la archives
- mkdir -pv /run/cache
- cp -vR archives /run/cache
- rm -rfv /run/cache/results
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
- b2 upload-file --contentType 'text/plain' "$B2_BUCKET_NAME" "/run/cache/archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg-SHA512SUM" "results/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg-SHA512SUM" > /dev/null 2>&1
- b2 upload-file --contentType 'application/zstd' "$B2_BUCKET_NAME" "/run/cache/archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg" "results/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd.gpg" > /dev/null 2>&1
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