-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
164 lines (158 loc) · 4.57 KB
/
config.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
base_system: &qa_system
docker:
- image: lecaoquochung/scala:dev
working_directory: /home/qa/code
version: 2
jobs:
build:
<<: *qa_system
steps:
- checkout
- add_ssh_keys:
fingerprints:
- restore_cache:
key: qa-build-{{ checksum "package.json" }}
- run:
name: Validate dockerfile dependencies
command: |
npm --version; # npm install # TODO type safe error in node_modules
yarn --version;
psql -V;
- run:
name: yarn dependencies
command: |
yarn install
- run:
name: Generate the Scala application bundle
command: |
sudo sbt clean dist
- persist_to_workspace:
root: .
paths:
- ./
- save_cache:
paths:
- /home/qa/node_modules
- /home/qa/code/node_modules
- /home/.ivy2
key: qa-build-{{ checksum "package.json" }}
- store_artifacts:
path: /home/qa/target/universal/sample-play-scala-1.0-SNAPSHOT.zip
test:
<<: *qa_system
docker:
- image: lecaoquochung/scala:dev
- image: postgres:latest
environment:
- POSTGRES_DB=qa
- POSTGRES_USER=qa
- POSTGRES_PASSWORD=qaPassword
- POSTGRES_TEST_DB=test
- POSTGRES_TEST_USER=test
- POSTGRES_TEST_PASSWORD=testPassword
volumes:
- $PWD/docker/postgres/initdb:/docker-entrypoint-initdb.d
- image: redis:3.2.10
environment:
- DATABASE_URL=postgres://qa:qaPassword@localhost:5432/qa
- TEST_DATABASE_URL=postgres://test:testPassword@localhost:5432/test
steps:
- attach_workspace:
at: .
- restore_cache:
key: qa-build-{{ checksum "package.json" }}
- run:
name: Validate dockerfile dependencies
command: |
npm --version; # npm install # TODO type safe error in node_modules
yarn --version;
psql -V;
# - run: sbt "runMain" # TODO research # - run: sbt "runMain models.enums.EnumsGen" #
- run: sudo sbt test
- run:
name: Validate QA test data
command: |
./.circleci/test_db.sh
- run:
name: Start Server
command: |
./.circleci/start-server.sh
- run:
name: Test Frontend Reactjs
command: |
yarn webpack --mode=development
when: always
- run:
name: Test Cucumber
command: |
yarn cucumber -f json:report/report.json --publish
- run:
name: Test artifacts
command: |
./.circleci/test_artifact.sh
- store_test_results:
path: test-results
- store_artifacts:
path: artifact
build_and_test:
<<: *qa_system
docker:
- image: lecaoquochung/scala:dev
- image: postgres:latest
environment:
- POSTGRES_DB=qa
- POSTGRES_USER=qa
- POSTGRES_PASSWORD=qaPassword
- POSTGRES_TEST_DB=test
- POSTGRES_TEST_USER=test
- POSTGRES_TEST_PASSWORD=testPassword
volumes:
- $PWD/docker/postgres/initdb:/docker-entrypoint-initdb.d
- image: redis:3.2.10
environment:
- DATABASE_URL=postgres://qa:qaPassword@localhost:5432/qa
- TEST_DATABASE_URL=postgres://test:testPassword@localhost:5432/test
steps:
- checkout
- run:
name: Validate dockerfile dependencies
command: |
npm --version; # npm install # TODO type safe error in node_modules
yarn --version;
psql -V;
- run:
name: yarn dependencies
command: |
yarn install
- run:
name: Generate the Scala application bundle
command: |
sudo sbt clean dist
- run:
name: Validate dockerfile dependencies
command: |
npm --version; # npm install # TODO type safe error in node_modules
yarn --version;
psql -V;
- run: sudo sbt test
- run:
name: Validate QA test data
command: |
.circleci/test_db.sh
- run:
name: Start Server
command: |
./.circleci/start-server.sh
- run:
name: Test Cucumber
command: |
yarn cucumber -f json:report/report.json --publish
workflows:
version: 2
qa:
jobs:
- build
- build_and_test
- test:
requires:
- build