forked from beyondessential/tupaia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodeship-steps.yml
123 lines (121 loc) · 5.29 KB
/
codeship-steps.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
- type: parallel
name: validate-and-test
exclude: -e2e$
steps:
- type: parallel
name: validate
steps:
- name: validate branch name
service: validation
command: './packages/devops/scripts/ci/validateBranchName.sh'
- name: validate tests
service: validation
command: './packages/devops/scripts/ci/validateTests.sh'
- type: serial
name: test
steps:
- type: parallel
name: test-batch-1 # they're in sandboxed containers, but share a db which can't handle all at once
steps:
- name: test-admin-panel-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh admin-panel-server'
- name: test-lesmis-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh lesmis-server'
- name: test-meditrak-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh meditrak-server'
- name: test-web-config-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh web-config-server'
- name: test-psss-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh psss-server'
- name: test-report-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh report-server'
- name: test-entity-server
service: testing
command: './packages/devops/scripts/ci/testBackend.sh entity-server'
- type: parallel
name: test-batch-2
steps:
- name: test-database
service: testing
command: './packages/devops/scripts/ci/testBackend.sh database'
- name: test-data-api
service: testing
command: './packages/devops/scripts/ci/testBackend.sh data-api'
- name: test-auth
service: testing
command: './packages/devops/scripts/ci/testBackend.sh auth'
- name: test-indicators
service: testing
command: './packages/devops/scripts/ci/testBackend.sh indicators'
- name: test-internal-dependencies
service: testing
command: './packages/devops/scripts/ci/testInternalDependencies.sh'
- name: test-web-frontend
service: testing
command: './packages/devops/scripts/ci/testFrontend.sh web-frontend'
- type: serial
name: pull latest into ec2
service: deployment
exclude: -e2e$
steps:
- name: reinstate SSH Private Key File
# Need to use 'sed' here to remove open/close quotes, see: https://github.com/docker/compose/issues/2854
# Note: this issue is fixed in more recent versions of docker-compose (1.26+) but codeship still uses an older version
command: /bin/bash -c "echo -e $PRIVATE_SSH_KEY | sed -e 's/^"//' -e 's/"$//' >> /root/.ssh/id_rsa"
- name: chmod id_rsa
command: chmod 600 /root/.ssh/id_rsa
- name: pull latest and install dependencies
command: './packages/devops/scripts/ci/pullLatest.sh'
- type: serial
name: deploy-all
service: deployment
exclude: -e2e$
steps:
- type: serial
name: deploy-backends
steps:
- type: serial
name: restart-backends
steps:
- name: deploy-web-config-server
command: './packages/devops/scripts/ci/deployBackend.sh web-config-server'
- name: deploy-lesmis-server
command: './packages/devops/scripts/ci/deployBackend.sh lesmis-server'
- name: deploy-meditrak-server
command: './packages/devops/scripts/ci/deployBackend.sh meditrak-server'
- name: deploy-psss-server
command: './packages/devops/scripts/ci/deployBackend.sh psss-server'
- name: deploy-admin-panel-server
command: './packages/devops/scripts/ci/deployBackend.sh admin-panel-server'
- name: deploy-report-server
command: './packages/devops/scripts/ci/deployBackend.sh report-server'
- name: deploy-entity-server
command: './packages/devops/scripts/ci/deployBackend.sh entity-server'
# run migrations immediately after backend deployment has finished so there is minimal time for code/db mismatch
- name: run db migrations
command: './packages/devops/scripts/ci/runMigrations.sh'
# build front ends in serial because they consume a lot of resources, and can crash deployment if run in parallel
- type: serial
name: deploy-frontends
steps:
- name: deploy-web-frontend
command: './packages/devops/scripts/ci/deployFrontend.sh web-frontend'
- name: deploy-admin-panel
command: './packages/devops/scripts/ci/deployFrontend.sh admin-panel'
- name: deploy-psss
command: './packages/devops/scripts/ci/deployFrontend.sh psss'
- name: deploy-lesmis
command: './packages/devops/scripts/ci/deployFrontend.sh lesmis'
- type: parallel
name: e2e-test
service: e2e
tag: -e2e$
steps:
- name: e2e-test-web-frontend
command: './packages/devops/scripts/ci/testE2e.sh web-frontend'