-
OneDev mounts a directory to be used as cache (or create symbol link when shell executor is used instead of docker executor), and does not have any special "save cache" or "upload cache" action. Even if build is timed out or failed, the file written to cache will still be available for subsequent builds.
I tested with below build spec:
version: 13 jobs: - name: CI steps: - !CommandStep name: build image: alpine commands: - cd npm - touch somefile - sleep 60 useTTY: false condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL retryCondition: never maxRetries: 3 retryDelay: 30 cpuRequirement: 500 memoryRequirement: 256 caches: - key: npm path: npm timeout: 10After build finishes, check directory
<OneDev install dir>/cache/npm/<some uuid>and you will find touched filesomefilethere. -
Previous Value Current Value Open
Closed
-
| Type |
Improvement
|
| Priority |
Minor
|
| Assignee |
Issue Votes (0)
One of my builds takes a long time and timed out. Of course, I am aware that I may increase the time out period, but nevertheless the build failed. I noticed the cache was not updated at each step of the build: it had to be completely rebuilt by the nex build.
I think you should save the cache even when a build fails on time-out, so that it may be used by the next one.