File tree Expand file tree Collapse file tree 2 files changed +63
-1
lines changed Expand file tree Collapse file tree 2 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 2
2
- event : push
3
3
- event : pull_request
4
4
5
+ variables :
6
+ - &docker_config
7
+ DOCKER_CACHE : /woodpecker/cache/docker
8
+ - &minio_config
9
+ MINIO_HOST : https://s3.kclab.cloud
10
+ MINIO_ACCESS_KEY :
11
+ from_secret : minio_access_key
12
+ MINIO_SECRET_KEY :
13
+ from_secret : minio_secret_key
14
+ MINIO_BUCKET : cache-53030
15
+
5
16
clone :
6
17
git :
7
18
image : woodpeckerci/plugin-git:2.6
@@ -10,6 +21,17 @@ clone:
10
21
partial : false
11
22
12
23
steps :
24
+ - name : open cache
25
+ image : minio/mc:latest
26
+ environment :
27
+ << : [*docker_config, *minio_config]
28
+ commands :
29
+ - mkdir --parents $${DOCKER_CACHE}
30
+ - touch $${DOCKER_CACHE}/.keep
31
+ - mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
32
+ - mc cp --recursive minio/$${MINIO_BUCKET}/${CI_REPO}/docker/ $${DOCKER_CACHE}/
33
+ failure : ignore
34
+
13
35
- name : tagging
14
36
image : mcp/git:latest
15
37
commands :
@@ -24,8 +46,20 @@ steps:
24
46
from_secret : gitea_package
25
47
registry : git.kclab.cloud
26
48
tags_file : .tag
49
+ cache-to : type=local,dest=/woodpecker/cache/docker
50
+ cache-from :
51
+ - type=local\\,src=/woodpecker/cache/docker
27
52
buildkit_config : |
28
53
[registry."docker.io"]
29
54
mirrors = ["https://docker.mirrors.kclab.cloud/"]
30
55
build_args :
31
56
PYPI_MIRROR : https://mirrors.ustc.edu.cn/pypi/simple
57
+
58
+ - name : save cache
59
+ image : minio/mc:latest
60
+ environment :
61
+ << : [*docker_config, *minio_config]
62
+ commands :
63
+ - mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
64
+ - mc cp --recursive $${DOCKER_CACHE}/ minio/$${MINIO_BUCKET}/${CI_REPO}/docker/
65
+ failure : ignore
Original file line number Diff line number Diff line change 5
5
variables :
6
6
- &pip_config
7
7
PIP_INDEX_URL : https://mirrors.ustc.edu.cn/pypi/simple
8
+ - &pre_commit_config
9
+ PRE_COMMIT_HOME : /woodpecker/cache/pre-commit
10
+ - &minio_config
11
+ MINIO_HOST : https://s3.kclab.cloud
12
+ MINIO_ACCESS_KEY :
13
+ from_secret : minio_access_key
14
+ MINIO_SECRET_KEY :
15
+ from_secret : minio_secret_key
16
+ MINIO_BUCKET : cache-53030
8
17
9
18
steps :
19
+ - name : open cache
20
+ image : minio/mc:latest
21
+ environment :
22
+ << : [*pre_commit_config, *minio_config]
23
+ commands :
24
+ - mkdir --parents $${PRE_COMMIT_HOME}
25
+ - touch $${PRE_COMMIT_HOME}/.keep
26
+ - mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
27
+ - mc cp --recursive minio/$${MINIO_BUCKET}/${CI_REPO}/pre-commit/ $${PRE_COMMIT_HOME}/
28
+ failure : ignore
29
+
10
30
- name : pre-commit
11
31
image : python:3.12
12
32
environment :
13
- << : * pip_config
33
+ << : [*pre_commit_config, * pip_config]
14
34
commands :
15
35
- pip install pre-commit
16
36
- pip install '.[dev]'
17
37
- pre-commit run --all-files
38
+
39
+ - name : save cache
40
+ image : minio/mc:latest
41
+ environment :
42
+ << : [*pre_commit_config, *minio_config]
43
+ commands :
44
+ - mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
45
+ - mc cp --recursive $${PRE_COMMIT_HOME}/ minio/$${MINIO_BUCKET}/${CI_REPO}/pre-commit/
You can’t perform that action at this time.
0 commit comments