-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
51 lines (43 loc) · 1.32 KB
/
.gitlab-ci.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
image: node:8
variables:
# Configure postgres service (https://hub.docker.com/_/postgres/)
POSTGRES_DB: cgawsbrokerprodgq3wrvn8c8a772q
POSTGRES_USER: utz6kah1zq8t2nyg
POSTGRES_PASSWORD: ***REMOVED***
stages:
- test
cache:
untracked: true
key: "$CI_COMMIT_REF_NAME"
paths:
- node_modules/
services:
- postgres
connect:
image: postgres
stage: test
script:
- export PGPASSWORD=$POSTGRES_PASSWORD
# - cp srt-database-export.sql.gz srt-database.sql.gz
# - rm srt-database.sql
# - gzip -d srt-database.sql.gz
# - psql -h "postgres" $POSTGRES_DB $POSTGRES_USER < srt-database.sql
# - psql -h "postgres" $POSTGRES_DB $POSTGRES_USER -c "COPY ( SELECT * FROM information_schema.tables WHERE table_type LIKE '%TABLE' AND table_name != 'spatial_ref_sys' ) TO STDOUT WITH CSV"
test_with_lab:
stage: test
coverage: '/All files[^0-9]*\d+\.\d+/'
artifacts:
paths:
- coverage/
script:
- apt update
- apt install -y postgresql-client
- export PGPASSWORD=$POSTGRES_PASSWORD
- cp srt-database-export.sql.gz srt-database.sql.gz
- rm srt-database.sql || true
- gzip -d srt-database.sql.gz
- psql -h "postgres" $POSTGRES_DB $POSTGRES_USER < srt-database.sql
- npm install
- export NODE_ENV=gitlab
- ./node_modules/.bin/sequelize db:migrate
- npm test