forked from danihodovic/celery-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.jsonnet
56 lines (49 loc) · 1.19 KB
/
.drone.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
local drone = import 'vendor/github.com/honeylogic-io/utils-libsonnet/lib/drone.libsonnet';
local cacheStepCommon = {
image: 'meltwater/drone-cache',
environment: {
AWS_ACCESS_KEY_ID: {
from_secret: 'AWS_ACCESS_KEY_ID',
},
AWS_SECRET_ACCESS_KEY: {
from_secret: 'AWS_SECRET_ACCESS_KEY',
},
},
settings: {
cache_key: '{{ .Repo.Name }}_{{ checksum "poetry.lock" }}',
region: 'eu-central-1',
bucket: 'depode-ci-cache',
mount: [
'.poetry',
'.poetry-cache',
],
},
volumes: [{ name: 'cache', path: '/tmp/cache' }],
};
local rebuildCacheStep = cacheStepCommon {
name: 'rebuild-cache',
depends_on: [
'install-python-deps',
],
settings+: {
rebuild: true,
},
};
local restoreCacheStep = cacheStepCommon {
name: 'restore-cache',
settings+: {
restore: true,
},
};
local pythonPipelineWithoutCache = drone.pythonPipeline.new({
environment: {
POETRY_CACHE_DIR: '/drone/src/.poetry-cache',
POETRY_VIRTUALENVS_IN_PROJECT: 'true',
},
}, 'python:3.9');
local pythonPipeline = pythonPipelineWithoutCache {
steps: [restoreCacheStep] + pythonPipelineWithoutCache.steps + [rebuildCacheStep],
};
[
pythonPipeline,
]