forked from mattermost/mattermost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
159 lines (150 loc) · 4.49 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
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
stages:
- test
- build
- publish
- create-vars
- trigger-build-ee
include:
- project: mattermost/ci/mattermost-server
ref: master
file: private.yml
variables:
BUILD: "yes"
IMAGE_BUILD_SERVER: $CI_REGISTRY/mattermost/ci/images/mattermost-build-server:20220415_golang-1.18.1
IMAGE_BUILD_DOCKER: $CI_REGISTRY/mattermost/ci/images/mattermost-build-docker:19.03.14-1
IMAGE_DIND: $CI_REGISTRY/mattermost/ci/images/docker-dind:19.03.14-1
empty:
stage: create-vars
script:
- echo "empty"
.lint: # Commenting this job, because it is run in CircleCI
image: $CI_REGISTRY/mattermost/ci/images/golangci-lint:v1.39.0-1
stage: test
script:
- make config-reset
- make check-style #todo MM_VET_OPENSPEC_PATH='$CI_PROJECT_DIR/mattermost-api-reference/v4/html/static/mattermost-openapi-v4.yaml'
timeout: 60 mins
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
.layers: # Commenting this job, because it is run in CircleCI
image: $IMAGE_BUILD_SERVER
stage: test
script:
- make store-layers
- if [[ -n $(git status --porcelain) ]]; then echo "Please update the store layers using make store-layers"; exit 1; fi
- git reset --hard
- make app-layers
- if [[ -n $(git status --porcelain) ]]; then echo "Please update the app layers using make app-layers"; exit 1; fi
- git reset --hard
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
.test-mysql: # Commenting this job, because it is run in CircleCI
stage: test
image: $IMAGE_BUILD_DOCKER
services:
- name: $IMAGE_DIND
alias: docker
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_CONTENT_TRUST: 0
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ""
before_script:
- docker login ${CI_REGISTRY} --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
script:
- export COMPOSE_PROJECT_NAME="${CI_PIPELINE_IID}mysql"
- export RACE_MODE=""
- time cat .gitlab-ci/scripts/test/mysql.sh | /bin/bash
artifacts:
when: always
reports:
junit: report.xml
paths:
- build/logs
timeout: 2 hours
tags:
- k8s-memory
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
.test-postgres: # Commenting this job, because it is run in CircleCI
stage: test
image: $IMAGE_BUILD_DOCKER
services:
- name: $IMAGE_DIND
alias: docker
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_CONTENT_TRUST: 0
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ""
before_script:
- docker login ${CI_REGISTRY} --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
script:
- export COMPOSE_PROJECT_NAME="${CI_PIPELINE_IID}postgres"
- export RACE_MODE=""
- time cat .gitlab-ci/scripts/test/postgres.sh | /bin/bash
artifacts:
when: always
reports:
junit: report.xml
paths:
- build/logs
timeout: 2 hours
tags:
- k8s-memory
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
test-schema-mysql:
stage: test
image: $IMAGE_BUILD_DOCKER
services:
- name: $IMAGE_DIND
alias: docker
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_CONTENT_TRUST: 0
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ""
before_script:
- docker login ${CI_REGISTRY} --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
script:
- export COMPOSE_PROJECT_NAME="${CI_PIPELINE_IID}schemamysql"
- time cat .gitlab-ci/scripts/test-schema/mysql.sh | /bin/bash
artifacts:
paths:
- build/logs
tags:
- k8s-memory
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "cloud"'
- if: '$CI_COMMIT_REF_NAME =~ /^release-/'
test-schema-postgres:
stage: test
image: $IMAGE_BUILD_DOCKER
services:
- name: $IMAGE_DIND
alias: docker
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_CONTENT_TRUST: 0
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ""
before_script:
- docker login ${CI_REGISTRY} --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
script:
- export COMPOSE_PROJECT_NAME="${CI_PIPELINE_IID}schemapostgres"
- time cat .gitlab-ci/scripts/test-schema/postgres.sh | /bin/bash
artifacts:
paths:
- build/logs
tags:
- k8s-memory
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "cloud"'
- if: '$CI_COMMIT_REF_NAME =~ /^release-/'