|
|
@@ -1,17 +1,67 @@
|
|
|
1
|
+---
|
|
|
2
|
+################
|
|
|
3
|
+# Build & Test #
|
|
|
4
|
+################
|
|
|
5
|
+
|
|
1
|
6
|
kind: pipeline
|
|
2
|
|
-name: default
|
|
|
7
|
+name: run_tests
|
|
3
|
8
|
|
|
4
|
9
|
steps:
|
|
|
10
|
+# Test the vue theme
|
|
5
|
11
|
- name: test
|
|
6
|
12
|
image: node
|
|
7
|
13
|
commands:
|
|
8
|
14
|
- cd ./vue-theme
|
|
9
|
15
|
- npm install
|
|
10
|
16
|
- npm test
|
|
|
17
|
+ volumes:
|
|
|
18
|
+ # Link node_modules cache from host filesystem into container at the expected location
|
|
|
19
|
+ - name: node_cache
|
|
|
20
|
+ path: ./vue-theme/node_modules
|
|
11
|
21
|
|
|
12
|
22
|
- name: build
|
|
13
|
23
|
image: node
|
|
14
|
24
|
commands:
|
|
15
|
25
|
- cd ./vue-theme
|
|
16
|
|
- - npm install
|
|
17
|
|
- - npm run build
|
|
|
26
|
+ - npm run build
|
|
|
27
|
+ volumes:
|
|
|
28
|
+ # Link node_modules cache from host filesystem into container at the expected location
|
|
|
29
|
+ - name: node_cache
|
|
|
30
|
+ path: ./vue-theme/node_modules
|
|
|
31
|
+
|
|
|
32
|
+volumes:
|
|
|
33
|
+ - name: node_cache
|
|
|
34
|
+ host:
|
|
|
35
|
+ path: /tmp/cache/drone/node_modules
|
|
|
36
|
+
|
|
|
37
|
+---
|
|
|
38
|
+########################
|
|
|
39
|
+# Deploy to Production #
|
|
|
40
|
+########################
|
|
|
41
|
+
|
|
|
42
|
+kind: pipeline
|
|
|
43
|
+name: depluy
|
|
|
44
|
+depends_on:
|
|
|
45
|
+ # Must run after the first pipeline
|
|
|
46
|
+ - run_tests
|
|
|
47
|
+trigger:
|
|
|
48
|
+ status:
|
|
|
49
|
+ # Only runs if the first pipeline was fully successful
|
|
|
50
|
+ - success
|
|
|
51
|
+
|
|
|
52
|
+steps:
|
|
|
53
|
+# Test the vue theme
|
|
|
54
|
+- name: test
|
|
|
55
|
+ image: node
|
|
|
56
|
+ commands:
|
|
|
57
|
+ - pwd
|
|
|
58
|
+ - ls ./vue-theme/node_modules
|
|
|
59
|
+ volumes:
|
|
|
60
|
+ # Link node_modules cache from host filesystem into container at the expected location
|
|
|
61
|
+ - name: node_cache
|
|
|
62
|
+ path: ./vue-theme/node_modules
|
|
|
63
|
+
|
|
|
64
|
+volumes:
|
|
|
65
|
+ - name: node_cache
|
|
|
66
|
+ host:
|
|
|
67
|
+ path: /tmp/cache/drone/node_modules
|