Skip to content

Commit 0d71f9a

Browse files
author
Winter
authored
Merge pull request code-dot-org#26896 from code-dot-org/drone-s3-cache
Drone.io - cache .rbenv dir
2 parents d3f21d3 + 54017bb commit 0d71f9a

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.drone.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,22 @@ steps:
2424
exit 1
2525
fi
2626
27+
- name: restore-cache
28+
image: plugins/s3-cache
29+
settings:
30+
pull: true
31+
restore: true
32+
access_key:
33+
from_secret: S3_CACHE_ACCESS_KEY
34+
secret_key:
35+
from_secret: S3_CACHE_SECRET_KEY
36+
2737
- name: unit-tests
2838
image: wintercdo/code-dot-org:0.7
39+
pull: always
2940
volumes:
41+
- name: rbenv
42+
path: /home/circleci/.rbenv
3043
- name: mysql
3144
path: /var/lib/mysql
3245
environment:
@@ -37,9 +50,28 @@ steps:
3750
commands:
3851
- pwd
3952
- sudo chown -R circleci:circleci .
53+
- # cache is restored to source directory, so we need to copy it into the right place
54+
- cp -rn "$(pwd)/home/circleci/.rbenv" /home/circleci || true
4055
- /entrypoint.sh docker/unit_tests.sh
4156

57+
- name: update-cache
58+
image: plugins/s3-cache
59+
volumes:
60+
- name: rbenv
61+
path: /home/circleci/.rbenv
62+
settings:
63+
pull: true
64+
rebuild: true
65+
access_key:
66+
from_secret: S3_CACHE_ACCESS_KEY
67+
secret_key:
68+
from_secret: S3_CACHE_SECRET_KEY
69+
mount:
70+
- /home/circleci/.rbenv
71+
4272
volumes:
73+
- name: rbenv
74+
temp: {}
4375
- name: mysql
4476
temp: {}
4577

@@ -109,6 +141,6 @@ trigger:
109141
# - pull_request
110142
---
111143
kind: signature
112-
hmac: 41f0921ccaed873a43f2608c4cabddf3911828cfc8044955f4420bf9fbaa8b98
144+
hmac: a37b3ff8767d1c25c2bd719f6372de50b2bfdef6c26cfb06075b5fcc05785a64
113145

114146
...

docker/unit_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ echo "Wrote secrets from env vars into locals.yml."
5757
set -x
5858

5959
# name: rake install
60-
RAKE_VERBOSE=true mispipe "bundle exec rake install" "ts '[%Y-%m-%d %H:%M:%S]'"
60+
RAKE_VERBOSE=true mispipe "bundle exec rake install --trace" "ts '[%Y-%m-%d %H:%M:%S]'"
6161

6262
# name: rake build
6363
RAKE_VERBOSE=true mispipe "bundle exec rake build --trace" "ts '[%Y-%m-%d %H:%M:%S]'"

0 commit comments

Comments
 (0)