Bläddra i källkod

:gear: updating drone and another test

tags/0.0.1^2
j 3 år sedan
förälder
incheckning
034f185b70
1 ändrade filer med 63 tillägg och 65 borttagningar
  1. 63
    65
      .drone.yml

+ 63
- 65
.drone.yml Visa fil

1
 ---
1
 ---
2
-################
3
-#    SECRETS   #
4
-################
5
-
6
-# push_deploy_key: id_rsa from DRONE host machine
7
----
8
 #################
2
 #################
9
 # Frontend Test #
3
 # Frontend Test #
10
 ################
4
 ################
15
 steps:
9
 steps:
16
     # Test the vue frontend
10
     # Test the vue frontend
17
     - name: test-frontend
11
     - name: test-frontend
18
-      image: node
19
-      commands:
20
-          - pwd
21
-          - cd ./frontend
22
-          - npm install
23
-          - npm test
24
-      volumes:
25
-          # Link node_modules cache from host filesystem into container at the expected location
26
-          - name: frontend_node_cache
12
+        image: node
13
+        commands:
14
+            - pwd
15
+            - cd ./frontend
16
+            - npm install
17
+            - npm test
18
+        volumes:
19
+            # Link node_modules cache from host filesystem into container at the expected location
20
+            - name: frontend_node_cache
27
             path: /drone/src/frontend/node_modules
21
             path: /drone/src/frontend/node_modules
28
 
22
 
29
 volumes:
23
 volumes:
30
     - name: frontend_node_cache
24
     - name: frontend_node_cache
31
-      host:
32
-          path: /tmp/cache/drone/frontend/node_modules
25
+        host:
26
+            path: /tmp/cache/drone/frontend/node_modules
33
     - name: frontend_build
27
     - name: frontend_build
34
-      host:
35
-          path: /tmp/cache/drone/frontend/build
28
+        host:
29
+            path: /tmp/cache/drone/frontend/build
36
 ---
30
 ---
37
 ##################
31
 ##################
38
 # Frontend Build #
32
 # Frontend Build #
40
 
34
 
41
 kind: pipeline
35
 kind: pipeline
42
 name: frontend_run_build
36
 name: frontend_run_build
37
+depends_on:
38
+    - frontend_run_tests
43
 trigger:
39
 trigger:
44
     status:
40
     status:
45
         # Only runs if the first pipeline was fully successful
41
         # Only runs if the first pipeline was fully successful
49
 
45
 
50
 steps:
46
 steps:
51
     - name: build-frontend
47
     - name: build-frontend
52
-      image: node
53
-      commands:
54
-          - cd ./frontend
55
-          - rm -Rf ./build/*
56
-          - npx browserslist@latest --update-db
57
-          - npm run build
58
-          - ls ./build
59
-      environment:
60
-          NODE_OPTIONS: --openssl-legacy-provider
61
-      volumes:
62
-          # Link node_modules cache from host filesystem into container at the expected location
63
-          - name: frontend_node_cache
48
+        image: node
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
+        volumes:
58
+            # Link node_modules cache from host filesystem into container at the expected location
59
+            - name: frontend_node_cache
64
             path: /drone/src/frontend/node_modules
60
             path: /drone/src/frontend/node_modules
65
-          - name: frontend_build
61
+            - name: frontend_build
66
             path: /drone/src/frontend/build
62
             path: /drone/src/frontend/build
67
 
63
 
68
 volumes:
64
 volumes:
69
     - name: frontend_node_cache
65
     - name: frontend_node_cache
70
-      host:
71
-          path: /tmp/cache/drone/frontend/node_modules
66
+        host:
67
+            path: /tmp/cache/drone/frontend/node_modules
72
     - name: frontend_build
68
     - name: frontend_build
73
-      host:
74
-          path: /tmp/cache/drone/frontend/build
69
+        host:
70
+            path: /tmp/cache/drone/frontend/build
75
 ---
71
 ---
76
 #################
72
 #################
77
 # Backend Tests #
73
 # Backend Tests #
83
 steps:
79
 steps:
84
     # Test the vue frontend
80
     # Test the vue frontend
85
     - name: test-backend
81
     - name: test-backend
86
-      image: node
87
-      commands:
88
-          - pwd
89
-          - cd ./backend
90
-          - npm install
91
-          - npm test
92
-      volumes:
93
-          # Link node_modules cache from host filesystem into container at the expected location
94
-          - name: backend_node_cache
95
-            path: /drone/src/backend/node_modules
82
+        image: node
83
+        commands:
84
+            - pwd
85
+            - cd ./backend
86
+            - npm install
87
+            - npm test
88
+        volumes:
89
+            # Link node_modules cache from host filesystem into container at the expected location
90
+            - name: backend_node_cache
91
+                path: /drone/src/backend/node_modules
96
 
92
 
97
 volumes:
93
 volumes:
98
     - name: backend_node_cache
94
     - name: backend_node_cache
99
-      host:
100
-          path: /tmp/cache/drone/backend/node_modules
95
+        host:
96
+            path: /tmp/cache/drone/backend/node_modules
101
     - name: backend_build
97
     - name: backend_build
102
-      host:
103
-          path: /tmp/cache/drone/backend/build
98
+        host:
99
+            path: /tmp/cache/drone/backend/build
104
 ---
100
 ---
105
 ########################
101
 ########################
106
 # Deploy to Production #
102
 # Deploy to Production #
111
 depends_on:
107
 depends_on:
112
     # Must run after the first pipeline
108
     # Must run after the first pipeline
113
     - frontend_run_tests
109
     - frontend_run_tests
110
+    - frontend_run_build
114
     - backend_run_tests
111
     - backend_run_tests
115
 trigger:
112
 trigger:
116
     status:
113
     status:
118
         - success
115
         - success
119
     branch:
116
     branch:
120
         - master
117
         - master
118
+
121
 steps:
119
 steps:
122
     # post-receive hook
120
     # post-receive hook
123
     - name: push commit
121
     - name: push commit
124
-      image: appleboy/drone-git-push:0.2.0-linux-amd64
125
-      settings:
126
-          branch: master
127
-          remote: maeda@165.232.128.85:/opt/staging/siimee.git
128
-          remote_name: staging
129
-          force: true
130
-          ssh_key:
131
-              # !: id_rsa from DRONE machine
132
-              from_secret: push_deploy_key
122
+        image: appleboy/drone-git-push:0.2.0-linux-amd64
123
+        settings:
124
+            branch: master
125
+            remote: maeda@165.232.128.85:/opt/staging/siimee.git
126
+            remote_name: staging
127
+            force: true
128
+            ssh_key:
129
+                # !: id_rsa from DRONE machine
130
+                from_secret: push_deploy_key
133
 
131
 
134
 volumes:
132
 volumes:
135
     - name: frontend_node_cache
133
     - name: frontend_node_cache
136
-      host:
137
-          path: /tmp/cache/drone/frontend/node_modules
134
+        host:
135
+            path: /tmp/cache/drone/frontend/node_modules
138
     - name: frontend_build
136
     - name: frontend_build
139
-      host:
140
-          path: /tmp/cache/drone/frontend/build
137
+        host:
138
+            path: /tmp/cache/drone/frontend/build
141
     - name: backend_node_cache
139
     - name: backend_node_cache
142
-      host:
143
-          path: /tmp/cache/drone/backend/node_modules
140
+        host:
141
+            path: /tmp/cache/drone/backend/node_modules

Laddar…
Avbryt
Spara