-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstd_save_cache.yml
More file actions
49 lines (49 loc) · 1.72 KB
/
std_save_cache.yml
File metadata and controls
49 lines (49 loc) · 1.72 KB
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
parameters:
cache_name:
type: string
path:
type: string
use_lockfile:
type: boolean
default: false
path_2:
type: string
default: ""
steps:
- unless:
condition: << parameters.path_2 >>
steps:
- save_cache:
name: Save << parameters.cache_name >> Cache
key: << parameters.cache_name >>-cache-{{ .Environment.CACHE_VERSION }}--branch--{{ .Branch }}--{{ .Revision }}
paths:
- << parameters.path >>
- when:
condition: << parameters.path_2 >>
steps:
- save_cache:
name: Save << parameters.cache_name >> Cache
key: << parameters.cache_name >>-cache-{{ .Environment.CACHE_VERSION }}--branch--{{ .Branch }}--{{ .Revision }}
paths:
- << parameters.path >>
- << parameters.path_2 >>
- when:
condition: << parameters.use_lockfile >>
steps:
- unless:
condition: << parameters.path_2 >>
steps:
- save_cache:
name: Save << parameters.cache_name >> Cache
key: << parameters.cache_name >>-cache-{{ .Environment.CACHE_VERSION }}--lockfile--{{ checksum "/home/circleci/code/yarn.lock" }}
paths:
- << parameters.path >>
- when:
condition: << parameters.path_2 >>
steps:
- save_cache:
name: Save << parameters.cache_name >> Cache
key: << parameters.cache_name >>-cache-{{ .Environment.CACHE_VERSION }}--lockfile--{{ checksum "/home/circleci/code/yarn.lock" }}
paths:
- << parameters.path >>
- << parameters.path_2 >>