forked from GAMS-dev/miro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
81 lines (75 loc) · 1.62 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
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
variables:
MIRO_DB_TYPE: postgres
MIRO_DB_HOST: postgres
MIRO_DB_NAME: mirotests
MIRO_DB_USERNAME: mirotests
MIRO_DB_PASSWORD: mirotests
POSTGRES_DB: $MIRO_DB_NAME
POSTGRES_USER: $MIRO_DB_USERNAME
POSTGRES_PASSWORD: $MIRO_DB_PASSWORD
POSTGRES_HOST_AUTH_METHOD: trust
stages:
- test
- deploy
services:
- name: postgres:12.1-alpine
image:
name: hub.gams.com:443/gamsmiro-ci:latest
lint_job:
tags:
- linux
stage: test
script:
- pre-commit run --all-files
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
paths:
- ${PRE_COMMIT_HOME}
rules:
- if: $CI_MERGE_REQUEST_ID
when: always
test_job:
tags:
- linux
stage: test
before_script:
- source /etc/profile.d/ci.sh
- yarn install --cache-folder .yarn
script:
- yarn run eslint .
- mchecklic
- mtestall
interruptible: true
cache:
paths:
- node_modules/
- .yarn
artifacts:
when: always
reports:
junit: src/tests/testthat/test-out.xml
paths:
- src/tests/logs-tests
expire_in: 1 week
rules:
- if: $CI_MERGE_REQUEST_TITLE =~ /^Draft:/
when: manual
- if: $CI_MERGE_REQUEST_ID
update_doc_job:
tags:
- linux
stage: deploy
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
script:
- rsync -rlptvz -e "ssh -o StrictHostKeyChecking=no" doc/* ubuntu@new.gams.com:/var/www/html/staging.gams.com/public_html/miro
rules:
- if: $CI_MERGE_REQUEST_ID
when: always
- when: manual
- allow_failure: true
needs: []