From e59371da9b3b1f36b68c794001e56894279f79cb Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 11 May 2020 04:29:30 +0200 Subject: [PATCH] added middle-step "copy-cache" --- .drone.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 83be2dd..2b57090 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,12 +25,9 @@ steps: volumes: - name: shm path: /dev/shm - - name: cache - path: /run/cache commands: - mkdir -pv results/${DRONE_STAGE_NAME}/test000 - robot -T -d results/${DRONE_STAGE_NAME}/test000 test000.robot - - cp -vR results /run/cache when: status: - success @@ -38,6 +35,23 @@ steps: depends_on: - reveal-env +- 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: + - test000 + volumes: - name: cache host: @@ -78,17 +92,14 @@ steps: - 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 + - tar cfv archives/results-${DRONE_COMMIT_SHA:0:7}.tar.zstd /run/cache/results-${DRONE_COMMIT_SHA} --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 + - rm -r /run/cache/results-${DRONE_COMMIT_SHA} when: status: - success