Просмотр исходного кода

:gear: added back backend testing to drone file

tags/0.0.1^2
j 3 лет назад
Родитель
Сommit
1f1c98a8ae
1 измененных файлов: 66 добавлений и 0 удалений
  1. 66
    0
      .drone.yml

+ 66
- 0
.drone.yml Просмотреть файл

@@ -1,3 +1,4 @@
1
+---
1 2
 #################
2 3
 # Frontend Test #
3 4
 #################
@@ -21,3 +22,68 @@ volumes:
21 22
     - name: frontend_node_cache
22 23
       host:
23 24
           path: /tmp/cache/drone/frontend/node_modules
25
+---
26
+##################
27
+# Frontend Build #
28
+##################
29
+
30
+kind: pipeline
31
+type: docker
32
+name: frontend_run_build
33
+depends_on:
34
+    - frontend_run_tests
35
+trigger:
36
+    status:
37
+        - success
38
+    branch:
39
+        - dev
40
+
41
+steps:
42
+    - name: build-frontend
43
+      image: node
44
+      volumes:
45
+          - name: frontend_node_cache
46
+            path: /drone/src/frontend/node_modules
47
+          - name: frontend_build
48
+            path: /drone/src/frontend/build
49
+      commands:
50
+          - cd ./frontend
51
+          - rm -Rf ./build/*
52
+          - npx browserslist@latest --update-db
53
+          - npm run build
54
+          - ls ./build
55
+      environment:
56
+          NODE_OPTIONS: --openssl-legacy-provider
57
+
58
+volumes:
59
+    - name: frontend_node_cache
60
+      host:
61
+          path: /tmp/cache/drone/frontend/node_modules
62
+    - name: frontend_build
63
+      host:
64
+          path: /tmp/cache/drone/frontend/build
65
+---
66
+#################
67
+# Backend Tests #
68
+#################
69
+
70
+kind: pipeline
71
+type: docker
72
+name: backend_run_tests
73
+
74
+steps:
75
+    - name: test-backend
76
+      image: node
77
+      volumes:
78
+          - name: backend_node_cache
79
+            path: /drone/src/backend/node_modules
80
+      commands:
81
+          - pwd
82
+          - cd ./backend
83
+          - npm install
84
+          - npm test
85
+
86
+volumes:
87
+    - name: backend_node_cache
88
+      host:
89
+          path: /tmp/cache/drone/backend/node_modules

Загрузка…
Отмена
Сохранить